As well as having to type passphrases, remembering the right user, key file, port and other settings for each host you want to SSH into might quickly become overwhelming.
That’s why, in addition to the command line options we saw so far, SSH also allows to read the same options from configuration files.
The configuration data will be applied from the following sources in the following order:
- command-line options
- user’s configuration file (located in
~/.ssh/config
) - system-wide configuration file (located in
/etc/ssh/ssh_config
)
How to write ~/.ssh/config
and /etc/ssh/ssh_config
files