Skip to content
loading...

Saved ssh configuration to quickly connect to servers

catalinxyz profile image Catalin Ion twitter logo github logo ・1 min read

Originally posted on catalinxyz.com

When working with servers and you have to connect through ssh multiple times it can be cumbersome to write ssh user@255.255.255.255 every time. We can save the connection details in the ssh config and simply run ssh serverName

Edit or create the config file if it doesn't exist

~/.ssh/config

Add a connection and save

Host {name}
    HostName {server_ip}
    User {username}
    IdentitiesOnly yes
    IdentityFile ~/.ssh/id_name

To connect run

ssh {name}
twitter logo DISCUSS
Discussion
markdown guide
Classic DEV Post from Jul 30 '19

What's your favorite question to be asked?

Catalin Ion profile image
Software developer with a focus on frontend