Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I get the following error when attempting to ssh to my server:
=========
Warning: the RSA host key for 'myServer' differs from the key for the IP address '192.168.0.1'
Offending key for IP in /home/user/.ssh/known_hosts:112
Matching host key in /home/user/.ssh/known_hosts:349
Are you sure you want to continue connecting (yes/no)?
=========
I have already attempted removing myServer from my known_hosts file and reattempting to ssh. Each time I access myServer I get this error, type yes and then gain access. Even though I gain access, I shouldn't be receiving this error.
Here are my steps: ssh myServer, yes, yes, I'm on myServer
Each time I remove the entry with 'myServer' in it, I get the below error:
=========
The authenticity of host 'myServer' (192.168.0.1)' can't be established.
RSA key fingerprint is xx:xx:xx
Are you sure you want to continue connecting (yes/no)? yes <- I typed
Warning: Permanently added 'myServer' (RSA) to the list of known hosts.
Warning: the RSA host key for 'myServer' differs from the key for the IP address '192.168.0.1'
Offending key for IP in /home/user/.ssh/known_hosts:112
Are you sure you want to continue connecting (yes/no)? yes <- I typed
Last Login: Thur Jul 8 07:13:59 from myComputer.myDomain.com
=========
I still get on the server, however I get the above error.
No, sorry. There's been a misunderstanding\miscommunication. Those were my actions. I'm on myComputer sshing to myServer. ACTION: myComputer# ssh myServer PROMPT: Are you sure you want to continue connecting (yes/no)? ACTION: yes PROMPT: Are you sure you want to continue connecting (yes/no)? ACTION: yes RESULT I have successfully ssh'd to myServer from myComputer.
I have removed all myServer entries from the known_hosts file whilest on myComputer and still receive the error:
=========
The authenticity of host 'myServer' (192.168.0.1)' can't be established.
RSA key fingerprint is xx:xx:xx
Are you sure you want to continue connecting (yes/no)? yes <- I typed
Warning: Permanently added 'myServer' (RSA) to the list of known hosts.
Warning: the RSA host key for 'myServer' differs from the key for the IP address '192.168.0.1'
Offending key for IP in /home/user/.ssh/known_hosts:112
Are you sure you want to continue connecting (yes/no)? yes <- I typed
Last Login: Thur Jul 8 07:13:59 from myComputer.myDomain.com
=========
I have removed all myServer entries from the known_hosts file whilest on myComputer and still receive the error:
=========
Yeah, that's what I said. While on myComputer, I remove any/all entries in my known_hosts file. I have other entries, but I'm not about to remove everything in my known_hosts file since I have nearly 300 entries.
I think I figured out something. The IP address of myServer was missing from known_hosts file. After sshing to myServer and loging out, I edited my known_hosts file and saw:
After adding my IP address to myServer, I ssh'd to myServer and got in w/o errors. Do you know what I need to do to have myServer write the IP to my known_hosts file?
This happened to me as well. What I noticed is that there were two entries in my client known_hosts file, one under server name, the other under ip address. When I removed both entries, I was able to clear this error.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.