Over the projects pile up servers, with them their access. Concerned about the safety of its application, the client often requires us restricted access by a range of options: extended username and password, specific port, VPN access, photo ID, digital control, checking DNA…
So I decided to simplify my life with… « alias ssh » (tadaaaaaa). Very easy to proceed: just create the file ~/.ssh/config, and store all your information as following:
You can now connect to your server through the following command:
$ ssh nickname
You agree that, for security reasons, the password should never be stored in this file. Now, you configure a « RSA key » .
« Ah, it’s so cool! But… when I type ‘ssh <tab> <tab>’, I don’t have any autocomplete?! »
Do not go too fast Hermes, one thing at a time. There is a tool for Linux and OSX improving it: bash-completion. Install it as follows, depending on your system:
$ apt-get install bash-completion
$ brew install bash-completion
$ yum install bash-completion
Finally, follow the directions by adding the following code in your ~/.bash_profile file (or ~/.bashrc):
if [ -f $(brew --prefix)/etc/bash_completion ]; then
. $(brew --prefix)/etc/bash_completion
If you run the command ‘ssh ni<tab> <tab>‘, the terminal will now propose known hosts in your system, recorded either in your ~/.ssh/config file or in the known hosts (~/.ssh/known_hosts).