Config File Locator

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.

  1. User level

    First configuration file

    Applies to SSH connections made by your user account.

    Config file location
    ~/.ssh/config
    The file may not exist yet. This is client configuration, not sshd_config for the SSH server.
    Commands
    vi "$HOME/.ssh/config"
  2. System level

    System defaults

    Provides defaults for options not already set by command-line or user configuration.

    Config file location
    /etc/ssh/ssh_config
    Editing this file may require administrator privileges.
    Commands
    vi /etc/ssh/ssh_config

Inspect configuration
ssh -G example.com

Official SSH (OpenSSH) documentation