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.


  • Output of awk '{print $1}' ~/.ssh/known_hosts can be found here.

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.


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.

  • 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, Can you pastebin a sample output ? – Panther Dec 10 '11 at 5:45
  • I have posted the output, have a look @ it pls. – karthick87 Dec 10 '11 at 5:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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