February 2020
Intermediate to advanced
666 pages
15h 45m
English
For a change of pace, let's look at the client's end now. This time, we'll look at a handy trick to help ease the pain of logging into different servers that require different keys or SSH options. All you have to do is go into the .ssh directory in your own home directory and create a config file. To demonstrate this, let's say that we've created either a DNS record or an /etc/hosts file entry for our servers so that we don't have to remember so many IP addresses.
Let's also say that we've created a separate pair of keys for each server that we need to access. In the ~/.ssh/config file, we can add a stanza that looks something like this:
Host ubuntu-nftables IdentityFile ~/.ssh/unft_id_rsa ...