Non-default location for ssh config file in Linux

-F configfile

Specifies an alternative per-user configuration file. If a configuration file is given on the command line, the system-wide configuration file (/etc/ssh/ssh_config) will be ignored. The default for the per-user configuration file is ~/.ssh/config.

Source: https://linux.die.net/man/1/ssh


As of OpenSSH 7.3p1, you can Include other config files in ssh_config.

So, you could add to /etc/ssh/ssh_config:

Include ~/custom_ssh.conf

Don't think this will stop the default ~/.ssh/config from being loaded, however.

Tags:

Linux

Ssh