Add Host configurations to ssh config
# ~/.ssh/config
# server on Amazon LightSail
Host lightsail
HostName tornado.mycooldomain.com
User kunami
IdentityFile ~/.ssh/id_rsa
Port 4234
Host
is followed by whatever alias you want to give the host definitionHostName
could be an FQDN or a numeric IP addressIdentityFile
is the SSH key used for connecting to the server. I always use a key..User
andPort
are self explanatory.Port
is good to specify here if you use custom ports (which you should).
You can also do other cool stuff like tunneling and port forwarding
Now you can do this:
ssh lightsail
instead of this:
ssh -i ~/.ssh/id_rsa -p 4234 kunami@tornado.mycooldomain.com