FANDOM


Edit SSh config: ~/.ssh/config

Host firsthost
    SSH_OPTION_1 custom_value
    SSH_OPTION_2 custom_value
    SSH_OPTION_3 custom_value
 
Host secondhost
    ANOTHER_OPTION custom_value
 
Host *host
    ANOTHER_OPTION custom_value
 
Host *
    CHANGE_DEFAULT custom_value


[1]

ValuesEdit

We define options using a key-value system. Each pair should be on a separate line. Keys can be separated from their associated values either by white space, or by an equal sign with optional white space.

Identity FileEdit

Host something
    HostName     10.10.10.10
    IdentityFile ~/.ssh/id_rsa_common

StrictHostKeyCheckingEdit

Host Something
    HostName     10.10.10.10
    User kona
    StrictHostKeyChecking no


SSH proxiesEdit

If you have an SSH server that’s only accessible to you via an SSH session on an intermediate machine, which is a very common situation when dealing with remote networks using private RFC1918 addresses through network address translation, you can automate that in .ssh/config too. Say you can’t reach the host nathost directly, but you can reach some other SSH server on the same private subnet that is publically accessible, publichost.example.com:

Host nathost

ProxyCommand ssh -q -W %h:%p public.example.com

This will allow you to just type:

$ ssh nathost