How to login on SSH without password

This mini-HOWTO explains how to login with OpenSSH without password.

To login on a remote server without being prompted for password, you need to store your public key on the server. If you don’t already have a public key, you need to generate a public/private key pair. To do that, just run following command:

ssh-keygen

This will prompt you for a location to save the keys, and a pass-phrase. Just accept te defaul values, i.e. ~/.ssh/id_rsa and empty pass-phrase.

When you have a public key, it is just a matter of running following command to copy the public key to te server:

ssh-copy-id user@machine

where user and machine should be replaced with your username on the remote server and the host name of the remote server, respectively.

You should now be able to login on the remote server without being promoted for the password, e.g.

ssh user@machine uptime

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • You can use Markdown syntax to format and style the text.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <p>
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.