Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > ssh hosts location?

ssh hosts location?
Thread Tools
Mac Enthusiast
Join Date: Dec 2002
Location: Newport Beach, CA
Status: Offline
Reply With Quote
Sep 9, 2003, 05:07 PM
 
When you ssh to a new host for the first time, it adds the key to the list of known hosts. Can someone refresh my memory of which file this is? Thanks...

Better yet, how do I remove a known host?
(Last edited by EnVoy; Sep 9, 2003 at 05:16 PM. )

Be a traveler, not a tourist
     
Senior User
Join Date: Jan 2001
Location: Mahwah, NJ USA
Status: Offline
Reply With Quote
Sep 9, 2003, 06:26 PM
 
Originally posted by EnVoy:
When you ssh to a new host for the first time, it adds the key to the list of known hosts. Can someone refresh my memory of which file this is? Thanks...

Better yet, how do I remove a known host?
The file(s) are in ~/.ssh/ (a hidden folder in your home folder) there are usually two files known_hosts and known_hosts2 depending on which protocol is used. You can edit the files with a text editor. The files have a single line for each host entry... the line is really long , typically several hundred characters. Because of this you must be careful that your text editor does NOT insert "helpful" newlines or carriage returns. I usually use vi to edit the known_hosts file(s). If you know the line number of the offending host it is as easy as:

Code:
vi +n .ssh/known_hosts dd :wq
where n is the line number.
-DU-...etc...
     
EnVoy  (op)
Mac Enthusiast
Join Date: Dec 2002
Location: Newport Beach, CA
Status: Offline
Reply With Quote
Sep 9, 2003, 06:41 PM
 
That's it, thanks....

Be a traveler, not a tourist
     
   
Thread Tools
Forum Links
Forum 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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 10:25 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2