-3

I have a problem with ssh connection to my remote server. I've just reinstalled remote server recently.

enter image description here


user:~/workspace/cheops-master/frontend $ ssh -o PreferredAuthentications=password root@##.###.##.###
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
##:##:##:##:##:##:##:##:##:##:##:##:##:db:20:1a.
Please contact your system administrator.
Add correct host key in /home/ubuntu/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /home/ubuntu/.ssh/known_hosts:17
  remove with: ssh-keygen -f "/home/ubuntu/.ssh/known_hosts" -R ##.###.##.###
ECDSA host key for ##.###.##.### has changed and you have requested strict checking.
Host key verification failed.

This approach doesn't work and it really drives my nuts.

How to connect via ssh with just a password? How to reset any configs for previous server?

P.S. If configs somehow were saved from previous server, I have no idea how it happened because there was no key for previous server and no special configs, just password was used, and yes, there is no need to use the key in my case.

Any advice will be appreciated, thanks!

1 Answers1

0

Issue was due to /home/ubuntu/.ssh/known_hostsfile which is updated automatically and every new ssh connection/ip-address was saved there with rsa key for some reason despite that fact that I used only password for ssh connection, so that this rule was blocking connection with fresh reinstalled remote server with the same ip-address.

I cleared the necessary addresses and this problem is gone. Hope this will help someone.

Jeff Schaller
  • 67,283
  • 35
  • 116
  • 255
  • 2
    The rsa hash saved in known_hosts is the host key of the remote server (this is mentioned in the warning message), and has nothing to do with whether you used a key or password to connect. Also, the warning message that was given contains clear instructions for how to remove the erroneous (old) host key from this file. – Kusalananda Jun 28 '19 at 13:07
  • well, the question was not posted clearly and you had the solution right in front of your eyes. judging by the amount of information you provided initially, I do not see why my answer was wrong in your opinion. – Bart Jun 28 '19 at 14:32