Solved

accessing known_hosts file on MAC OS 10.6

Posted on 2014-03-06
6
1,996 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 29

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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will cover some tips for successfully installing the new update to OS X; 10.5.7. Although the information contained within could be used for any OS X point release.  Please note that this information applies to point releases to a parti…
In this article we have discussed about the OS X EI Capitan and how to fix Wi-Fi issue in OS X El Capitan. We have explained how to delete system level preferences and create a new Wi-Fi location to resolve Wi-Fi issue.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

861 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