SSH configuration files
For the SSH client there are typically two places where configuration files are stored: in the home directory of the user and a global configuration file.
User configuration
- Location: ~/.ssh/config
This file is stored in the home directory of an user. It is optional and by default no file is available.
System-wide configuration
- Location: /etc/ssh/ssh_config
- Overrides via: /etc/ssh/ssh_config.d/*.conf
The default settings are in the ssh_config file. The system administrator may add customizations to this file, but typically it is advised to override settings using a separate configuration file. This way settings are not being overwritten by accident when a new package is released.
Order of precedence
The SSH client has a defined order of precedence when it comes to evaluating settings.
- Command-line options
- Configuration file of user
- Configuration file of system
Options defined on the command-line will have the highest priority and therefore override settings in configuration files. The user configuration will override the settings in the system-wide configuration.