Hacker News new | ask | show | jobs
by dryicerx 5258 days ago
Two more places to extract hostnames for ssh auto completion are .ssh/known_hosts and the .ssh/config.

Or give zsh a try, simply autoload compinit and it will do ssh/sftp auto completions along with a boatload more out of the box.

2 comments

I usually set up my SSH autocompletes to read from known_hosts. The problem is that on some systems, like say Debian, the hostnames are hashed for security reasons. So you have to add the following line to your .ssh/config to get the hostnames back into a readable form.

    HashKnownHosts no
Ian MacDonald's bash completions (http://www.caliban.org/bash/) do this with known_hosts.