Pages

Sunday, June 1, 2014

Tips for ~/.ssh/config file

You can add SSH client configurations that can ease your life a little bit. Here are some tips you could put in your ~/.ssh/config file.

Host *
HashKnownHosts no

Host *.example.com
ServerAliveInterval 300
ForwardX11 no
User me


Host *.example2.com
ServerAliveInterval 300
User anotherme


The HashKnownHosts directive sets whether to hash the SSH hosts in the ~/.ssh/known_hosts file. It is enabled by default, but hashing the hosts prevents tab-completion of the hostnames in your shell.

To have the tab-completion, you may need to remove the servers hashes lines in the known_hosts file first and then try to reconnect to your SSH server so you can have a new unhashed entry in it. If you are too lazy (like me :-), you can remove or rename your ~/.ssh/known_hosts file.

No comments:

Post a Comment