Config File Locator

SSH (OpenSSH) config file locations


Commands use a POSIX shell (macOS, Linux, or WSL). Install the named editor or CLI first. Before using an environment-variable path, check that the variable is set to a non-empty, intended path. When using vi or Notepad, ensure the parent directory exists and is writable. A missing file is created when you save it; Notepad may ask to create it.

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