Bio

Christopher Flynn

Webdeveloper, husband, dad, surfer, ameteur photographer, tinkerer, 2nd amendment advocate, brewer, chef, libertarian, atheist, UNIX Geek, troublemaker.


SSH config file

I use SSH all the time. It's primary role is to allow you to securely log into remote computers and it does this extremely well. You can also use it (via scp or sftp) to transfer files and you can also use it to route traffic through. However remembering ip addresses, especially for machines you rarely use, or typing in domain names can be a chore. Fortunately there is an easy way to specify shortcuts, the config file.

In your ~/.ssh/ folder, create a file called config that looks like the following:
host abbr
port 1234
hostname 192.168.0.5
user myusername

Now you can just type 'ssh abbr' and it will try to log you into 192.168.0.5 as myusername and port 1234. You can also use it with scp: 'scp abbr:filename .' which would transfer the file 'filename' to your current directory from the server. You can do a lot of other things such as specify a compression level, port, identity file (useful if you use EC2 and need to specify a .pem file), keepalive and more.

This combined with key files makes using ssh effortless.

Comments

Comments are currently disabled for this post.

 
Christopher Flynn