Linux - Security This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
Due to network maintenance being performed by our provider, LQ will be down starting at 05:01 AM UTC. The exact duration of the downtime isn't currently known. We apologize for the inconvenience.
|
 |
07-08-2010, 07:06 AM
|
#1
|
|
LQ Newbie
Registered: Sep 2008
Location: Ohio
Distribution: RHEL4&5 (work) Fedora&Ubuntu(home)
Posts: 25
Rep:
|
rsa host key error while trying to ssh to server
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. 
|
|
|
|
07-08-2010, 07:13 AM
|
#2
|
|
Member
Registered: Feb 2010
Distribution: gentoo, arch, fedora, freebsd
Posts: 379
Rep:
|
remove 192.168.0.1 from your known_hosts file line 112.
|
|
|
|
07-08-2010, 07:15 AM
|
#3
|
|
LQ Newbie
Registered: Sep 2008
Location: Ohio
Distribution: RHEL4&5 (work) Fedora&Ubuntu(home)
Posts: 25
Original Poster
Rep:
|
There is no 192.168.0.1 in the known_hosts file.
|
|
|
|
07-08-2010, 08:48 AM
|
#4
|
|
Senior Member
Registered: Feb 2004
Location: Chicago
Distribution: CentOS
Posts: 1,180
Rep:
|
Remove line 112 and 349 from known hosts.
|
|
|
|
07-08-2010, 10:31 AM
|
#5
|
|
LQ Newbie
Registered: Sep 2008
Location: Ohio
Distribution: RHEL4&5 (work) Fedora&Ubuntu(home)
Posts: 25
Original Poster
Rep:
|
I've tried that. I've removed all records of myServer and 192.168.0.1 from the known_hosts file.
|
|
|
|
07-08-2010, 10:36 AM
|
#6
|
|
Senior Member
Registered: Feb 2004
Location: Chicago
Distribution: CentOS
Posts: 1,180
Rep:
|
Quote:
Originally Posted by abti
I've tried that. I've removed all records of myServer and 192.168.0.1 from the known_hosts file.
|
It wouldn't be giving that error then, you must have removed it from the wrong known_hosts file
|
|
|
|
07-08-2010, 11:12 AM
|
#7
|
|
LQ Newbie
Registered: Sep 2008
Location: Ohio
Distribution: RHEL4&5 (work) Fedora&Ubuntu(home)
Posts: 25
Original Poster
Rep:
|
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.
|
|
|
|
07-08-2010, 11:22 AM
|
#8
|
|
Senior Member
Registered: Feb 2004
Location: Chicago
Distribution: CentOS
Posts: 1,180
Rep:
|
Quote:
Originally Posted by abti
Here are my steps: ssh myServer, yes, yes, I'm on myServer
|
What? You are already on myServer and you are trying to SSH to it?
You need to remove the entries from known_hosts on the local server not the remote server.
|
|
|
|
07-08-2010, 11:34 AM
|
#9
|
|
LQ Newbie
Registered: Sep 2008
Location: Ohio
Distribution: RHEL4&5 (work) Fedora&Ubuntu(home)
Posts: 25
Original Poster
Rep:
|
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
=========
|
|
|
|
07-08-2010, 11:52 AM
|
#10
|
|
Senior Member
Registered: Feb 2004
Location: Chicago
Distribution: CentOS
Posts: 1,180
Rep:
|
YOu have to clear known_hosts on your computer, not the server.
|
|
|
|
07-08-2010, 12:00 PM
|
#11
|
|
LQ Newbie
Registered: Sep 2008
Location: Ohio
Distribution: RHEL4&5 (work) Fedora&Ubuntu(home)
Posts: 25
Original Poster
Rep:
|
Quote:
Originally Posted by abti
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.
|
|
|
|
07-08-2010, 02:19 PM
|
#12
|
|
LQ Newbie
Registered: Sep 2008
Location: Ohio
Distribution: RHEL4&5 (work) Fedora&Ubuntu(home)
Posts: 25
Original Poster
Rep:
|
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:
myServer ssh-rsa AAAAWEFv4df5asbzasasfeawbnoosdnf0asn0na0
myServer2, 192.168.0.2 ssh-rsa AAAAWEFv0ng0nasdfjw0asnoosdnf0asdfg433bF
myServer3, 192.168.0.3 ssh-rsa AAAAWEFasdfe0ng0n0asnsh6RGsfsfkgTasd0sdg
==
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?
|
|
|
|
01-09-2013, 06:45 AM
|
#13
|
|
LQ Newbie
Registered: Jan 2006
Location: Bel Air MD
Distribution: Fedora
Posts: 12
Rep:
|
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.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 04:40 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|