SSH Cheat Sheet

Task: login to remote host with username and password

Login to host:

  1. ssh  -l  [login] -p [port]

Task: login to remote host using a configured alias

First of all you need to configure the alias. The SSH configuration file is normlly stored in ~/.ssh/config. This is an example.

host
  1.  Hostname [hostname]
  2.  Port [port]
  3.  ForwardAgent [yes|no]
  4.  ForwardX11 [yes|no]
  5.  User [login]

Once you have an alias, you can specify the alias name instead of specify all the options as parameters.

  1. ssh [alias]

Task: login to remote host using key authentication