LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-25-2010, 09:40 PM   #1
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 1,397

Rep: Reputation: 101Reputation: 101
How to locate offending ssh key?


Using a Ubuntu 10.04 desktop...

I just rebuilt another computer (Ubuntu 10.04-Server) and when I attempt to ssh to the box I of course have the ssh key from the old install. I get the message
Quote:
Add correct host key in /home/ken/.ssh/known_hosts to get rid of this message.
Offending key in /home/ken/.ssh/known_hosts:3
So how do I determine which key is hosts:3? It is not the third key in the known_hosts file - I deleted that one and got the same error.

As I only have 4 other computers on my network I generally just delete all entries from known_hosts when I reinstall the OS on one of the others. It is about time I learn how to do it correctly

TIA,

Ken
 
Old 11-25-2010, 10:33 PM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,808

Rep: Reputation: 604Reputation: 604Reputation: 604Reputation: 604Reputation: 604Reputation: 604
.. It's line 3 of known_hosts.

It's probable the server had two sequential keys in that file and you only deleted one.
 
Old 11-26-2010, 12:02 AM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Quote:
Add correct host key in /home/ken/.ssh/known_hosts to get rid of this message.
Offending key in /home/ken/.ssh/known_hosts:3
In brief:

Code:
sed -i '3d' /home/ken/.ssh/known_hosts

Cheers,
Tink

Last edited by Tinkster; 11-26-2010 at 12:04 AM.
 
1 members found this post helpful.
Old 11-28-2010, 09:57 AM   #4
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 1,397

Original Poster
Rep: Reputation: 101Reputation: 101
Many thanks Tinkster That does the trick.

Ken
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
open-ssh vs. commercial ssh (tru64), public-key auth not possible? cf050 Linux - Networking 8 03-28-2012 12:15 PM
Putty/SSH login failed when using RSA public key: 'Server refused our key' itsecx@gmail.com Linux - Server 10 10-04-2010 02:19 PM
Locate second disk path from ssh and copy a folder to it ASTRAPI Linux - Newbie 8 06-10-2010 08:46 AM
Offending Hairulfr General 4 08-11-2008 05:16 AM
ssh / ssh-key -- its always asking for passphrase BaerRS Linux - General 1 01-07-2003 07:21 PM


All times are GMT -5. The time now is 07:18 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration