What command to clear the error of âREMOTE HOST IDENTIFICATION HAS CHANGED!â
Clash Royale CLAN TAG#URR8PPP
up vote
2
down vote
favorite
ssh -p yyyy root@xxxxxxxxx
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Offending ECDSA key in /home/debian8/.ssh/known_hosts:28
remove with: ssh-keygen -f "/home/user/.ssh/known_hosts" -R [xxxx]:yyyy
ECDSA host key for [xxxxxxxx]:yyyy has changed and you have requested strict checking.
Host key verification failed.
Doing as warning say.
$ ssh-keygen -f "/home/user/.ssh/known_hosts" -R [xxxx]:yyyy
/home/user/.ssh/known_hosts is not a valid known_hosts file.
Not replacing existing known_hosts file because of errors
Which command to execute now?
ssh
add a comment |Â
up vote
2
down vote
favorite
ssh -p yyyy root@xxxxxxxxx
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Offending ECDSA key in /home/debian8/.ssh/known_hosts:28
remove with: ssh-keygen -f "/home/user/.ssh/known_hosts" -R [xxxx]:yyyy
ECDSA host key for [xxxxxxxx]:yyyy has changed and you have requested strict checking.
Host key verification failed.
Doing as warning say.
$ ssh-keygen -f "/home/user/.ssh/known_hosts" -R [xxxx]:yyyy
/home/user/.ssh/known_hosts is not a valid known_hosts file.
Not replacing existing known_hosts file because of errors
Which command to execute now?
ssh
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
ssh -p yyyy root@xxxxxxxxx
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Offending ECDSA key in /home/debian8/.ssh/known_hosts:28
remove with: ssh-keygen -f "/home/user/.ssh/known_hosts" -R [xxxx]:yyyy
ECDSA host key for [xxxxxxxx]:yyyy has changed and you have requested strict checking.
Host key verification failed.
Doing as warning say.
$ ssh-keygen -f "/home/user/.ssh/known_hosts" -R [xxxx]:yyyy
/home/user/.ssh/known_hosts is not a valid known_hosts file.
Not replacing existing known_hosts file because of errors
Which command to execute now?
ssh
ssh -p yyyy root@xxxxxxxxx
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Offending ECDSA key in /home/debian8/.ssh/known_hosts:28
remove with: ssh-keygen -f "/home/user/.ssh/known_hosts" -R [xxxx]:yyyy
ECDSA host key for [xxxxxxxx]:yyyy has changed and you have requested strict checking.
Host key verification failed.
Doing as warning say.
$ ssh-keygen -f "/home/user/.ssh/known_hosts" -R [xxxx]:yyyy
/home/user/.ssh/known_hosts is not a valid known_hosts file.
Not replacing existing known_hosts file because of errors
Which command to execute now?
ssh
ssh
edited Oct 9 '17 at 11:52
Arrow
2,400218
2,400218
asked Oct 9 '17 at 11:09
scrapy
17215
17215
add a comment |Â
add a comment |Â
4 Answers
4
active
oldest
votes
up vote
3
down vote
If you are sure that only the key is incorrect and you choose to remove it.
List of alternative solutions:
1.- Execute the recommended command.
The command to be executed is right there in the error message:
$ ssh-keygen -f "/home/user/.ssh/known_hosts" -R [xxxx]:yyyy
replace
xxxx
by hostname or IP used in connection with sshyyyy
by port number (if non standard)
That will remove the failing key, then just re-connect to get the new key in the file.
2.- Remove line 28 of file
The error also state that the failing line is:
Offending ECDSA key in /home/debian8/.ssh/known_hosts:28
The line numbered 28, which could be removed with a text editor, or with:
sed -i '28d' "/home/user/.ssh/known_hosts"
then reconnect to get the correct key.
3.- Move the file.
Move the file to a backup (for future reference/use/extraction of keys)
mv /home/user/.ssh/known_hosts /home/user/.ssh/known_hosts_backup
let ssh rebuild the file as each new host is contacted.
4.- Erase the whole file
If all the above fails, erase the whole file
rm "/home/user/.ssh/known_hosts"
it will be rebuilt for each new host you re-connect to.
1
Nope, the OP says that's not working for them.
â Ulrich Schwarz
Oct 9 '17 at 11:22
All of the optional solutions? @UlrichSchwarz
â Arrow
Oct 9 '17 at 11:31
@archemar Thanks for your edit. If you downvoted, please review it again.
â Arrow
Oct 9 '17 at 11:48
I didn't downvote, just edit.ssh-keyscan
might be used to rebuildknown_hosts
but that'll require some thought.
â Archemar
Oct 9 '17 at 11:55
add a comment |Â
up vote
1
down vote
The error message "/home/user/.ssh/known_hosts is not a valid known_hosts file." shows the problem. ssh-keygen
is unable to parse the file because it has been corruptedâmost likely by incorrect manual editing.
If you don't have a recent backup, the easiest solution would be to move the corrupted known_hosts
aside and allow ssh
to generate a new one. You will have to re-accept keys for any remote hosts which you had previously accepted.
$ mv /home/user/.ssh/known_hosts /home/user/.ssh/known_hosts.old
add a comment |Â
up vote
0
down vote
Do you use host name hashing? If not, you can use a text editor to remove the matching line in /home/user/.ssh/known_hosts
starting with the hostname. It should look a bit like this:
hostname-or-ip ecdsa-sha2-nistp256 AAAA...
(for other interested readers, the ecdsa
-bit could also be ssh-rsa
, but here, it's explicitly complaining about a ECDSA key.)
add a comment |Â
up vote
0
down vote
The SSH warning means that remote host xxxxxxxxx's public key has changed. This is either due to the remote host's administrator having changed the public key, or to an intruder performing a man-in-the-middle attack between your machine and the remote host.
If you are absolutely sure it's the former case, remove the cached invalid key from .ssh/known_hosts
by editing the file and removing the line starting with the remote host name.
You are missing the part where the questioner tried to do that, and was told that it was "not a valid known_hosts file".
â JdeBP
Oct 9 '17 at 14:38
add a comment |Â
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
If you are sure that only the key is incorrect and you choose to remove it.
List of alternative solutions:
1.- Execute the recommended command.
The command to be executed is right there in the error message:
$ ssh-keygen -f "/home/user/.ssh/known_hosts" -R [xxxx]:yyyy
replace
xxxx
by hostname or IP used in connection with sshyyyy
by port number (if non standard)
That will remove the failing key, then just re-connect to get the new key in the file.
2.- Remove line 28 of file
The error also state that the failing line is:
Offending ECDSA key in /home/debian8/.ssh/known_hosts:28
The line numbered 28, which could be removed with a text editor, or with:
sed -i '28d' "/home/user/.ssh/known_hosts"
then reconnect to get the correct key.
3.- Move the file.
Move the file to a backup (for future reference/use/extraction of keys)
mv /home/user/.ssh/known_hosts /home/user/.ssh/known_hosts_backup
let ssh rebuild the file as each new host is contacted.
4.- Erase the whole file
If all the above fails, erase the whole file
rm "/home/user/.ssh/known_hosts"
it will be rebuilt for each new host you re-connect to.
1
Nope, the OP says that's not working for them.
â Ulrich Schwarz
Oct 9 '17 at 11:22
All of the optional solutions? @UlrichSchwarz
â Arrow
Oct 9 '17 at 11:31
@archemar Thanks for your edit. If you downvoted, please review it again.
â Arrow
Oct 9 '17 at 11:48
I didn't downvote, just edit.ssh-keyscan
might be used to rebuildknown_hosts
but that'll require some thought.
â Archemar
Oct 9 '17 at 11:55
add a comment |Â
up vote
3
down vote
If you are sure that only the key is incorrect and you choose to remove it.
List of alternative solutions:
1.- Execute the recommended command.
The command to be executed is right there in the error message:
$ ssh-keygen -f "/home/user/.ssh/known_hosts" -R [xxxx]:yyyy
replace
xxxx
by hostname or IP used in connection with sshyyyy
by port number (if non standard)
That will remove the failing key, then just re-connect to get the new key in the file.
2.- Remove line 28 of file
The error also state that the failing line is:
Offending ECDSA key in /home/debian8/.ssh/known_hosts:28
The line numbered 28, which could be removed with a text editor, or with:
sed -i '28d' "/home/user/.ssh/known_hosts"
then reconnect to get the correct key.
3.- Move the file.
Move the file to a backup (for future reference/use/extraction of keys)
mv /home/user/.ssh/known_hosts /home/user/.ssh/known_hosts_backup
let ssh rebuild the file as each new host is contacted.
4.- Erase the whole file
If all the above fails, erase the whole file
rm "/home/user/.ssh/known_hosts"
it will be rebuilt for each new host you re-connect to.
1
Nope, the OP says that's not working for them.
â Ulrich Schwarz
Oct 9 '17 at 11:22
All of the optional solutions? @UlrichSchwarz
â Arrow
Oct 9 '17 at 11:31
@archemar Thanks for your edit. If you downvoted, please review it again.
â Arrow
Oct 9 '17 at 11:48
I didn't downvote, just edit.ssh-keyscan
might be used to rebuildknown_hosts
but that'll require some thought.
â Archemar
Oct 9 '17 at 11:55
add a comment |Â
up vote
3
down vote
up vote
3
down vote
If you are sure that only the key is incorrect and you choose to remove it.
List of alternative solutions:
1.- Execute the recommended command.
The command to be executed is right there in the error message:
$ ssh-keygen -f "/home/user/.ssh/known_hosts" -R [xxxx]:yyyy
replace
xxxx
by hostname or IP used in connection with sshyyyy
by port number (if non standard)
That will remove the failing key, then just re-connect to get the new key in the file.
2.- Remove line 28 of file
The error also state that the failing line is:
Offending ECDSA key in /home/debian8/.ssh/known_hosts:28
The line numbered 28, which could be removed with a text editor, or with:
sed -i '28d' "/home/user/.ssh/known_hosts"
then reconnect to get the correct key.
3.- Move the file.
Move the file to a backup (for future reference/use/extraction of keys)
mv /home/user/.ssh/known_hosts /home/user/.ssh/known_hosts_backup
let ssh rebuild the file as each new host is contacted.
4.- Erase the whole file
If all the above fails, erase the whole file
rm "/home/user/.ssh/known_hosts"
it will be rebuilt for each new host you re-connect to.
If you are sure that only the key is incorrect and you choose to remove it.
List of alternative solutions:
1.- Execute the recommended command.
The command to be executed is right there in the error message:
$ ssh-keygen -f "/home/user/.ssh/known_hosts" -R [xxxx]:yyyy
replace
xxxx
by hostname or IP used in connection with sshyyyy
by port number (if non standard)
That will remove the failing key, then just re-connect to get the new key in the file.
2.- Remove line 28 of file
The error also state that the failing line is:
Offending ECDSA key in /home/debian8/.ssh/known_hosts:28
The line numbered 28, which could be removed with a text editor, or with:
sed -i '28d' "/home/user/.ssh/known_hosts"
then reconnect to get the correct key.
3.- Move the file.
Move the file to a backup (for future reference/use/extraction of keys)
mv /home/user/.ssh/known_hosts /home/user/.ssh/known_hosts_backup
let ssh rebuild the file as each new host is contacted.
4.- Erase the whole file
If all the above fails, erase the whole file
rm "/home/user/.ssh/known_hosts"
it will be rebuilt for each new host you re-connect to.
edited Oct 9 '17 at 12:05
answered Oct 9 '17 at 11:15
Arrow
2,400218
2,400218
1
Nope, the OP says that's not working for them.
â Ulrich Schwarz
Oct 9 '17 at 11:22
All of the optional solutions? @UlrichSchwarz
â Arrow
Oct 9 '17 at 11:31
@archemar Thanks for your edit. If you downvoted, please review it again.
â Arrow
Oct 9 '17 at 11:48
I didn't downvote, just edit.ssh-keyscan
might be used to rebuildknown_hosts
but that'll require some thought.
â Archemar
Oct 9 '17 at 11:55
add a comment |Â
1
Nope, the OP says that's not working for them.
â Ulrich Schwarz
Oct 9 '17 at 11:22
All of the optional solutions? @UlrichSchwarz
â Arrow
Oct 9 '17 at 11:31
@archemar Thanks for your edit. If you downvoted, please review it again.
â Arrow
Oct 9 '17 at 11:48
I didn't downvote, just edit.ssh-keyscan
might be used to rebuildknown_hosts
but that'll require some thought.
â Archemar
Oct 9 '17 at 11:55
1
1
Nope, the OP says that's not working for them.
â Ulrich Schwarz
Oct 9 '17 at 11:22
Nope, the OP says that's not working for them.
â Ulrich Schwarz
Oct 9 '17 at 11:22
All of the optional solutions? @UlrichSchwarz
â Arrow
Oct 9 '17 at 11:31
All of the optional solutions? @UlrichSchwarz
â Arrow
Oct 9 '17 at 11:31
@archemar Thanks for your edit. If you downvoted, please review it again.
â Arrow
Oct 9 '17 at 11:48
@archemar Thanks for your edit. If you downvoted, please review it again.
â Arrow
Oct 9 '17 at 11:48
I didn't downvote, just edit.
ssh-keyscan
might be used to rebuild known_hosts
but that'll require some thought.â Archemar
Oct 9 '17 at 11:55
I didn't downvote, just edit.
ssh-keyscan
might be used to rebuild known_hosts
but that'll require some thought.â Archemar
Oct 9 '17 at 11:55
add a comment |Â
up vote
1
down vote
The error message "/home/user/.ssh/known_hosts is not a valid known_hosts file." shows the problem. ssh-keygen
is unable to parse the file because it has been corruptedâmost likely by incorrect manual editing.
If you don't have a recent backup, the easiest solution would be to move the corrupted known_hosts
aside and allow ssh
to generate a new one. You will have to re-accept keys for any remote hosts which you had previously accepted.
$ mv /home/user/.ssh/known_hosts /home/user/.ssh/known_hosts.old
add a comment |Â
up vote
1
down vote
The error message "/home/user/.ssh/known_hosts is not a valid known_hosts file." shows the problem. ssh-keygen
is unable to parse the file because it has been corruptedâmost likely by incorrect manual editing.
If you don't have a recent backup, the easiest solution would be to move the corrupted known_hosts
aside and allow ssh
to generate a new one. You will have to re-accept keys for any remote hosts which you had previously accepted.
$ mv /home/user/.ssh/known_hosts /home/user/.ssh/known_hosts.old
add a comment |Â
up vote
1
down vote
up vote
1
down vote
The error message "/home/user/.ssh/known_hosts is not a valid known_hosts file." shows the problem. ssh-keygen
is unable to parse the file because it has been corruptedâmost likely by incorrect manual editing.
If you don't have a recent backup, the easiest solution would be to move the corrupted known_hosts
aside and allow ssh
to generate a new one. You will have to re-accept keys for any remote hosts which you had previously accepted.
$ mv /home/user/.ssh/known_hosts /home/user/.ssh/known_hosts.old
The error message "/home/user/.ssh/known_hosts is not a valid known_hosts file." shows the problem. ssh-keygen
is unable to parse the file because it has been corruptedâmost likely by incorrect manual editing.
If you don't have a recent backup, the easiest solution would be to move the corrupted known_hosts
aside and allow ssh
to generate a new one. You will have to re-accept keys for any remote hosts which you had previously accepted.
$ mv /home/user/.ssh/known_hosts /home/user/.ssh/known_hosts.old
answered Oct 9 '17 at 11:22
user4556274
4,98811123
4,98811123
add a comment |Â
add a comment |Â
up vote
0
down vote
Do you use host name hashing? If not, you can use a text editor to remove the matching line in /home/user/.ssh/known_hosts
starting with the hostname. It should look a bit like this:
hostname-or-ip ecdsa-sha2-nistp256 AAAA...
(for other interested readers, the ecdsa
-bit could also be ssh-rsa
, but here, it's explicitly complaining about a ECDSA key.)
add a comment |Â
up vote
0
down vote
Do you use host name hashing? If not, you can use a text editor to remove the matching line in /home/user/.ssh/known_hosts
starting with the hostname. It should look a bit like this:
hostname-or-ip ecdsa-sha2-nistp256 AAAA...
(for other interested readers, the ecdsa
-bit could also be ssh-rsa
, but here, it's explicitly complaining about a ECDSA key.)
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Do you use host name hashing? If not, you can use a text editor to remove the matching line in /home/user/.ssh/known_hosts
starting with the hostname. It should look a bit like this:
hostname-or-ip ecdsa-sha2-nistp256 AAAA...
(for other interested readers, the ecdsa
-bit could also be ssh-rsa
, but here, it's explicitly complaining about a ECDSA key.)
Do you use host name hashing? If not, you can use a text editor to remove the matching line in /home/user/.ssh/known_hosts
starting with the hostname. It should look a bit like this:
hostname-or-ip ecdsa-sha2-nistp256 AAAA...
(for other interested readers, the ecdsa
-bit could also be ssh-rsa
, but here, it's explicitly complaining about a ECDSA key.)
answered Oct 9 '17 at 11:16
Ulrich Schwarz
8,96012643
8,96012643
add a comment |Â
add a comment |Â
up vote
0
down vote
The SSH warning means that remote host xxxxxxxxx's public key has changed. This is either due to the remote host's administrator having changed the public key, or to an intruder performing a man-in-the-middle attack between your machine and the remote host.
If you are absolutely sure it's the former case, remove the cached invalid key from .ssh/known_hosts
by editing the file and removing the line starting with the remote host name.
You are missing the part where the questioner tried to do that, and was told that it was "not a valid known_hosts file".
â JdeBP
Oct 9 '17 at 14:38
add a comment |Â
up vote
0
down vote
The SSH warning means that remote host xxxxxxxxx's public key has changed. This is either due to the remote host's administrator having changed the public key, or to an intruder performing a man-in-the-middle attack between your machine and the remote host.
If you are absolutely sure it's the former case, remove the cached invalid key from .ssh/known_hosts
by editing the file and removing the line starting with the remote host name.
You are missing the part where the questioner tried to do that, and was told that it was "not a valid known_hosts file".
â JdeBP
Oct 9 '17 at 14:38
add a comment |Â
up vote
0
down vote
up vote
0
down vote
The SSH warning means that remote host xxxxxxxxx's public key has changed. This is either due to the remote host's administrator having changed the public key, or to an intruder performing a man-in-the-middle attack between your machine and the remote host.
If you are absolutely sure it's the former case, remove the cached invalid key from .ssh/known_hosts
by editing the file and removing the line starting with the remote host name.
The SSH warning means that remote host xxxxxxxxx's public key has changed. This is either due to the remote host's administrator having changed the public key, or to an intruder performing a man-in-the-middle attack between your machine and the remote host.
If you are absolutely sure it's the former case, remove the cached invalid key from .ssh/known_hosts
by editing the file and removing the line starting with the remote host name.
answered Oct 9 '17 at 11:21
dr01
15.4k114769
15.4k114769
You are missing the part where the questioner tried to do that, and was told that it was "not a valid known_hosts file".
â JdeBP
Oct 9 '17 at 14:38
add a comment |Â
You are missing the part where the questioner tried to do that, and was told that it was "not a valid known_hosts file".
â JdeBP
Oct 9 '17 at 14:38
You are missing the part where the questioner tried to do that, and was told that it was "not a valid known_hosts file".
â JdeBP
Oct 9 '17 at 14:38
You are missing the part where the questioner tried to do that, and was told that it was "not a valid known_hosts file".
â JdeBP
Oct 9 '17 at 14:38
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f396986%2fwhat-command-to-clear-the-error-of-remote-host-identification-has-changed%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password