Solved

accessing known_hosts file on MAC OS 10.6

Posted on 2014-03-06
6
1,831 Views
Last Modified: 2014-08-15
Hi, I am fairly new to macs.  I need to edit the known_hosts file and can't find it.  I have tried showing all files by entering this command:  defaults write com.apple.Finder AppleShowAllFiles TRUE
killall finder

I am still not seeing this file anywhere!  Can someone please help!
0
Comment
Question by:kathyb0209
  • 2
6 Comments
 
LVL 39

Accepted Solution

by:
Eoin OSullivan earned 250 total points
ID: 39909594
If you're looking for that file in your .SSH folder you'll not be able to see in the Finder by defaults .. that command you entered DOES NOT reveal system level hidden folders.

Open a Terminal window and enter
cd ~/.ssh

Open in new window

then enter
ls -al

Open in new window


If the known_hosts file exists youll see it there ... you can then open it in the terminal editor as follows
pico known_hosts

Open in new window


Alternatively in the Finder .. in the Go menu select 'Go to Folder'.  Then paste in the path
~/.ssh

Open in new window

It will open the Folder in the Finder
You can see the file if it is in there ... and open with a program like TextWrangler an excellent text editor FREE for OSX .. http://www.barebones.com/products/textwrangler/
0
 
LVL 27

Assisted Solution

by:serialband
serialband earned 250 total points
ID: 39910050
On the POSIX (unix/linux/osx) filesystem, any file preceded with a . (dot) is "hidden"  you can always navigate to them and you can also view them on the terminal command line with -a option. (e.g. ls -a or ls -la.

If you want to open them in the finder, go to the command line and type open ~/.ssh if you're not in your home folder or open .ssh if you are.

If you're removing hosts from the file, then you can just run the following on the command line
ssh-keygen -R HOSTNAME

You can search for a hostname with
ssh-keygen -F HOSTNAME

You normally let ssh prompt you to add host keys, but if you have a file, you can append it to known_hosts.  I frequently  generate a list of known host keys for users to check against or insert into their own known_hosts file.

cat MY_HOST_KEY >> ~/.ssh/known_hosts
cat MY_HOST_KEY_LIST >> ~/.ssh/known_hosts
0
 

Author Comment

by:kathyb0209
ID: 40191860
I've requested that this question be deleted for the following reason:

I figured out the issue on my own. Thank you!
0
 
LVL 39

Expert Comment

by:Eoin OSullivan
ID: 40191861
What did you figure out yourself?  How was it different from the advice supplied?  Please post your solution for the benefit of the experts and others in the future who may have your issue.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

With the major release of Apple's 7th addition to the Mac OS X family, Mac OS X 10.6 Snow Leopard, there are a lot of enhancements which have arrived with this new OS X upgrade. With the number of enhancements and refinements I can provide deta…
Do you come here a lot? Are you lazy like me and don't want to go through the "trouble" of having to click your Dock's Safari icon and then having to click your Experts Exchange Favorites bookmark to get here? Well then this article is for you.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now