Thursday, November 25, 2010

Configure SSH to connect to a server without username/password

If you are bored having to enter your username and password everytime you connect to a server you can do the following

In your pc run "ssh-keygen"

This will generate public/private rsa key pair.

Then run "ssh-copy-id username@servername"

This will copy the appropriate files to the remote server

Now you can connect to the server and you will not be asked for your credentials.

You can also add the following lines to your ~/.ssh/config file

Host servername
 User username
 Port 2222


This will always connect you to the servername using username at port 2222