Configuration of hosts for convenient ssh connections

2013-07-12
#ssh #linux #console

It is possible to save the configuration of an SSH connection for later usage. For example, one had to type

1ssh <username>@<ip address> -p <port> -i <path to key file>

every time one wants to connect to the server.

Create ~/.ssh/config with the following content:

1Host <name>
2  Hostname <ip address>
3  Port <port>
4  User <username>
5  IdentityFile <path to key file (if any)>

Now just type

1ssh <name>

to connect to the server.