Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SSH error in connection to a new Domain

Tags:

ssh

ssh-keys

I was already able to connect to the server via ssh properly. But recently after changing the server fixed-IP address and domain name, I cannot connect to the server by DNS name. Despite, I can ssh to the server with its IP address. The error of ssh with domain name is the following:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@       WARNING: POSSIBLE DNS SPOOFING DETECTED!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
The DSA host key for example.com has changed,
and the key for the corresponding IP address X.X.X.X
has a different value. This could either mean that
DNS SPOOFING is happening or the IP address for the host
and its host key have changed at the same time.
Offending key for IP in /home/.ssh/known_hosts:10
  remove with: ssh-keygen -f "/home/.ssh/known_hosts" -R X.X.X.X
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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 DSA key sent by the remote host is
*:*:*:*:*:....
Please contact your system administrator.
Add correct host key in /home/.ssh/known_hosts to get rid of this message.
Offending DSA key in /home/.ssh/known_hosts:11
  remove with: ssh-keygen -f "/home/.ssh/known_hosts" -R example.com
DSA host key for example.com has changed and you have requested strict checking.
Host key verification failed.
like image 558
Masood Avatar asked Nov 04 '13 11:11

Masood


People also ask

What does connection refused mean in SSH?

The SSH “Connection refused” error occurs when you try to connect to an SSH server (Secure Socket Shell), but the connection fails. SSH is a network protocol that allows you to execute numerous tasks over an encrypted and secure connection.

What is the known hosts file SSH?

Definition(s): A file associated with a specific account that contains one or more host keys. Each host key is associated with an SSH server address (IP or hostname) so that the server can be authenticated when a connection is initiated.


2 Answers

The answer is in the question:

ssh-keygen -f "/home/.ssh/known_hosts" -R example.com

You will get more info on the first google hit for the big message. WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!

like image 102
damienfrancois Avatar answered Nov 11 '22 14:11

damienfrancois


You should remove line 10 from your known_hosts because the system signalized you about the problem Offending key for IP in /home/.ssh/known_hosts:10

like image 5
AlexKh Avatar answered Nov 11 '22 13:11

AlexKh