Terminal - ssh - REMOTE HOST IDENTIFICATION HAS CHANGED?

I am trying to do some command line networking, but when I type ssh root@"devices ip address" it comes up with the error:

lucas-computer:~ LukeB$ ssh root@10.0.1.6
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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
fd:07:34:3b:d1:76:1e:c2:e7:95:14:d3:b2:23:47:7f.
Please contact your system administrator.
Add correct host key in /Users/LukeB/.ssh/known_hosts to get rid of this message.
Offending key in /Users/LukeB/.ssh/known_hosts:4
RSA host key for 10.0.1.6 has changed and you have requested strict checking.
Host key verification failed.


I know for a fact nobody is "doing anything nasty" so am not worried, but when I go to add the key to known hosts I type: /Users/LukeB/.ssh/known_hosts
into terminal and receive the error:

lucas-computer:~ LukeB$ /Users/LukeB/.ssh/known_hosts
-bash: /Users/LukeB/.ssh/known_hosts: Permission denied

Why is this as I am a system admin?

Can anybody tell me very simply how to add the correct host key to known hosts?

Thanks

Macbook Pro, Mac OS X (10.4.9), 15"/2.33/2gb/120gb external 20" 500gb

Posted on Nov 17, 2007 5:16 AM

Reply
1 reply

Nov 17, 2007 6:26 AM in response to magic_man

Whoa, you're playing around a root and you don't know what's going on here? I would highly recommend some more reading up on things.

Typing "/Users/LukeB/.ssh/known_hosts" into Terminal won't do squat, and it shouldn't either.

known_hosts is just a plain text file with the RSA keys of remote hosts that you have connected to previously.

Did you happen to reinstall the system or muck around with the sshd configuration on the remote machine you're trying to connect to? Or is this perhaps a different machine with the same IP address as the machine that you have in your known_hosts?

At any rate, you can just clean out the known_hosts file and the warning will go away and allow you to connect.

Open up Terminal and do:
echo "" > .ssh/known_hosts

(note that the above is two sets of quotes)

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Terminal - ssh - REMOTE HOST IDENTIFICATION HAS CHANGED?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.