Why using a Private key to connect on your Linux servers?
This will prevent you entering the password each time you want to connect via SSH on your Linux server.
On the server
On your Linux server as root we’re going to create a new user
# adduser NEWUSERNAME
Connect as NEWUSERNAME
# su NEWUSERNAME
Generating an authentiction key
$ ssh-keygen -b 1024 -f MyKEY -t dsa
This will generate one public key “MyKEY.pub” and one private key “MyKEY”
Create .ssh directory
$ mkdir ~/.ssh
$ cat MyKEY.pub > ~/.ssh/authorized_keys
Next copy/move MyKey into the client system
On the client
Use your favorite SSH client and the MyKEY to connect on the server without prompting you for password
ssh -i /Path/To/MyKEY NEWUSERNAME@MyServer
There you go, congratulations!
Caution: you must be careful to whom you give/share the private key, best practice is to create each user’s key.