Last Updated: February 25, 2016
·
756
· usharf

Quickly log in to remote servers using ssh's config file

Use ssh's config file to keep shortcuts and connection parameters to quickly login into frequently accessed servers.

In ~/.ssh/config, put:

host example
  Hostname www.example.com
  Port 7933
  User username

Use like this:

ssh example

or:

ssh-copy-id -i id_rsa.pub example

or even so:

vim scp://example/somefile.txt
  • The User parameter might not be needed, if you've already setup ssh "password-less" login

2 Responses
Add your response

You can also set the IdentityFile in your config to point to your secret key.

over 1 year ago ·

That's helpful, thanks!

over 1 year ago ·