For OpenSSH, the SSH client user configuration file is named config, and the SSH client system-wide configuration file is named ssh_config. The files reside at the following locations:

  • User configuration file location: $HOME/.ssh/config

  • System-wide configuration file default location: /etc/ssh/ssh_config

    An SSH client obtains its configurations from the ssh command-line options, the user configuration file, and the system-wide configuration file, in that order. For each parameter, the SSH client uses the first obtained value for that parameter.

    Because of the potential for abuse, the config file must have strict permissions: read/write for the user, and not accessible by others. From the $HOME directory, executing the following UNIX command acquires these permissions:

                   chmod go-rwx .ssh/*

    The ssh_config file provides defaults for those values that are not specified in the config file. This file must be world-readable.

    The SSH server has its own set of configuration files, including the SSH server system-wide configuration file named sshd_config. By default, these files reside in the /etc/ssh directory on the remote host.

    The configuration files enable an administrator to set parameters that modify the operation of the SSH client and the SSH server.