[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

accessing known_hosts file on MAC OS 10.6

Posted on 2014-03-06
6
Medium Priority
?
2,559 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
6 Comments
 
LVL 41

Accepted Solution

by:
Eoin OSullivan earned 1000 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 30

Assisted Solution

by:serialband
serialband earned 1000 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 41

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

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

In certain circumstances, a Microsoft Office mac application may fail to save a document to a network server, with the following error message: "There has been a network or file permission error. The network connection may be lost." An article at…
This article outlines the struggles that Macs encounter in Windows-dominated workplace environments – and what Mac users can do to improve their network connectivity and remain productive.
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 …
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…

650 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