Skip to content

Passwordless SSH Authentication on Linux

There are two ways of achieving passwordless authentication on a Linux Box.

On Debian/Ubuntu you can just type:

Press Enter each question and you will have a pair of keys ready to use.

You will be asked for a passphrase but if you do not want to insert anything just leave it blank.

This procedure will create one private and one public key.

At this time you will be asked for the password but once the key has been copied you will be able to ssh just perfectly.

As additional security you could lock the account to prevent someone without key to ssh into the box. In order to do that

will lock the account “me” preventing anyone using password credentials for that account. You will only be able to access with you trusted ssh-key. If you don’t want anymore the account locked just type:

-U flag will unlock the account


the “ssh-copy-id” utility doesn’t exist so you will have to copy it manually.
If you can copy and paste then

Paste the line into the remote server’s .ssh/authorized_keys file.

If you can’t copy and paste and want to have the confidence the key has been correctly copied just scp the to the server

For more info

comments powered by Disqus