$ ssh qbert @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ 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 the RSA host key has just been changed. The fingerprint for the RSA key sent by the remote host is c5:f1:e3:66:81:2f:6e:e1:6a:41:1b:21:a2:05:45:f3. Please contact your system administrator. Add correct host key in /home/giallu/.ssh/known_hosts to get rid of this message. Offending key in /home/giallu/.ssh/known_hosts:84 RSA host key for qbert has changed and you have requested strict checking. Host key verification failed. lost connection
The key changed because I reinstalled that machine so there is not really anyone trying nasty things, I just need to get rid of that line (84). In order to open the file in vim at that line I used:
$ vim +84 /home/giallu/.ssh/known_hosts
followed by "dd" (delete line) and ":wq" (save and exit)
That's all for today's vim trick...
You can make it simplier :
ReplyDeletesed -i 84d ~/.ssh/known_hosts
will delete line 84 and save the file.
Yeah, "sed -i" is a very nice trick I use from time to time, just not a vim one ;)
ReplyDeleteIt’s a shame gvim can’t open /home/giallu/.ssh/known_hosts:84 as a filename and navigate to the line, plenty of output in bash has this format - thats one feature from BeOS CLI that I miss…
ReplyDeleteWhat about...?
ReplyDelete$ ssh-keygen -R qbert
I know, I know... I'm just saying ;)
Toh, è un'opzione che funziona anche in emacs
ReplyDelete(diciamolo per par condicio)
(certo che ne è uscita una bella panoramica sul tema :) )
I made a very useful script that allows you to open file:line and vim does the right thing. With this script installed you can use "vim /home/giallu/.ssh/known_hosts:84" witch is nice since it can be obtained by copy and paste directly from the error message.
ReplyDeletehttp://www.vim.org/scripts/script.php?script_id=2184