SSH access : Time saVVy Hack

If you deal with a lot of servers and SSH connections, then this post is a must read for you, welcome.

I will go through some easy tricks, which will make your SSH login to server without asking a things.

How to setup :

  1. Setup key based SSH access
  2. Command alias

Start with issuing following commands :

$ ssh-keygen

Then ssh-keygen will ask you the filename in which to store the generated key in ~/.ssh/YourFileName

Next, copy the key’s .pub file to the server, which you want to connect using ssh.

$ ssh-copy-id -i ~/.ssh/YourFileName.pub user@server.com

now open you ~/.bashrc file, and add alias. Paste this code in the end of your .bashrc file, and change values accordingly

alias conny='ssh user@server'

Save and exit, thats it, you just run $ conny or any other name you wrote there. It will setup an SSH connection directly to the server.