SSH config

Do you connect to various SSH hosts from one computer ? Have you written own script to avoid writing long commands ? I did it the same, until I’ve found ssh_config

It’s really simple. You can define your own SSH configurations for various hosts with various configurations. All you have to do is create file 

/home/[user]/.ssh/config

and write configuration there

Host [name]
    HostName [IP address]
    User [User name]
    Port [port]
    IdentityFile [path to your private key]
Host [name-2]
    HostName [IP address]
    User [User name]
    PubkeyAuthentication no

All options I’ve mentioned are pretty straight forward ( I would say ) Of course this is not complete list of options you can use. You can find nice descriptive list i.e. on www.ssh.com 

Last thing I will mention is how to actually do SSH login. Base on my above example I can use i.e. 

ssh name-2

in order connect to second configuration.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.