Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have setup-ed key based SSH authentication to all the systems. How ever i have missed out few systems. If i taken the address of the added hosts, i can find out the non added hosts address. Is there any command to retreive the added hosts address? Thanks in advance.

Update

  • Output of awk '{print $1}' ~/.ssh/known_hosts can be found here.
share|improve this question
add comment

2 Answers 2

up vote 1 down vote accepted

What you have is a hashed known_hosts file, which is the default. These are one-way hashes of the host|key, so you cannot recover the actual hostname. This is intentional, as knowledge of all the hosts you have accessed and cached keys for (and, perhaps more importantly, knowing which ones you haven't) is fairly valuable to someone who wants to fool you into sharing your passwords with them. Its not enough if you're using SSH keys, as you may do something sensitive while logged in through an attacker's machine.

What you should do is ssh to all your machines, and verify the fingerprint carefully when doing so. Once you have all of them, you can distribute this known_hosts file to the clients that need it. Note that you can put it in /etc/ssh/known_hosts so that all users get it, not just your current user.

share|improve this answer
add comment

Not sure if this is what you want or not

awk '{print $1}' ~/.ssh/known_hosts

That will list the hosts you have connected to via ssh.

share|improve this answer
    
Yeah this is what i need, but it is not displaying the IP address. I need to viewe the IP address of the added hosts. –  karthick87 Dec 10 '11 at 5:40
    
what is it displaying ? I get a hostname and an ip address here. ssh.bodhizazen.net,174.44.163.74 Can you pastebin a sample output ? –  bodhi.zazen Dec 10 '11 at 5:45
    
I have posted the output, have a look @ it pls. –  karthick87 Dec 10 '11 at 5:49
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.