Add Host configurations to ssh config

# ~/.ssh/config

# server on Amazon LightSail
Host lightsail
  User kunami
  IdentityFile ~/.ssh/id_rsa
  Port 4234
  • Host is followed by whatever alias you want to give the host definition
  • HostName could be an FQDN or a numeric IP address
  • IdentityFile is the SSH key used for connecting to the server. I always use a key..
  • User and Port 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