As many people become lazy and choose increasingly weaker and weaker passwords due to the vast number they often need to remember it can become rather disappointing to hear that another simple password has been broken and confidential / personal data has been stolen. It often isn’t enough to simply ignore this issue and try to contain the password issue by alternative security measures.

A simple solution is available where public/private keys are used as the password for users to stop simple and easy to guess passwords being used on a regular basis. Initially the user will need to set a complex password to ensure while any migration is occurring you are not leaving the server wide open for attack.

On the node you wish to connect from issue the command

ssh-keygen -t dsa

Enter all the way through the prompts you are presented with.

Copy the contents of the file ~/.ssh/ to the remote server you wish to connect to and append it to ~/.ssh/authorizedkeys using the command

cat >> ~/.ssh/authorized_keys

Quickly change the permissions on the .ssh directory to 700 using the following command

chmod -R 700 ~/.ssh/