Solved

accessing known_hosts file on MAC OS 10.6

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

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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Mac OS reinstall process and move to SSD 12 80
Edit (Cut/Trim & save to file) .mov file 4 49
Mac Os Sierra Safari Tabs 12 60
Need a text scroller for a Mac 2 49
If you are using Mac OS X and have a large number of login items set up in accounts, under system preferences, you may find that your computer is sluggish and unresponsive during startup until everything is done launching. Another problem that a…
The /etc/authorization file in Mac OS X 10.x can be used to control access to the various panes of the System Preferences amongst other things. It’s used by some of us Mac Sys Admin’s to give Standard Users access to System Prefs panes that only adm…
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 …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

770 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