This is a response to SSH Tab Complete by Michael Lustfield.
Create a ~/.ssh/config
file and populate it with configurations. Doing this is the only step you need to do, and you don’t need to add anything to your ~/.bashrc
. Example ~/.ssh/config
:
# foobar.com Host foobar Hostname foobar.com User xxxxxxxxxxxxx # Home server (internal) Host iserver Hostname 10.0.0.2 User xxxxxxxxxxxx Port ####
Host is a simple word that will be used with ssh like ssh foobar
. Hostname is the actual IP address of domain name of the server. User is your username for that machine. Port is the ssh port number, if it isn’t the default port of 22.
So, when I want to ssh into my home server, I just do ssh is
, press tab, then enter. There are many more options to add to the config file as well, and a simple Google search will provide more. Also man ssh_config
will give you pretty much everything you need as well.