SSH (OpenSSH) config file locations
Find OpenSSH client configuration file locations and precedence on macOS, Linux, and Windows.
These files configure the OpenSSH client. For most options, the first value found wins: command-line options, then user settings, then system defaults. Put specific Host blocks before general defaults. ssh -F <config-file> replaces the user file and skips the system file. Include directives can load additional files. To inspect the effective settings with ssh -G, replace example.com with your target hostname or configured alias; this is not a connection test.
User level
First configuration fileApplies to SSH connections made by your user account.
Config file location
The file may not exist yet. This is client configuration, not sshd_config for the SSH server.~/.ssh/configCommands
vi "$HOME/.ssh/config"System level
System defaultsProvides defaults for options not already set by command-line or user configuration.
Config file location
Editing this file may require administrator privileges./etc/ssh/ssh_configCommands
vi /etc/ssh/ssh_config
Inspect configuration
ssh -G example.comOfficial SSH (OpenSSH) documentation