SSH login without password

L'Antre du Tryphon

schedule
2011-11-10 | 03:36h
update
2013-06-08 | 19:25h
person
www.ctheroux.com
domain
www.ctheroux.com

SSH login without password

It is possible to securely connect to a SSH server without a password. To do so, you must perform the following steps. It assumes that both machine are running a flavor of Unix.

On the client machine, open a shell window and execute the following command to create your private and your public key.

ssh-keygen -t rsa

Login on the server using the account you want to setup and perform these steps:

mkdir ~/.ssh chmod 700 ~/.ssh

The file id_rsa.pub can be found on your client machine in the ~/.ssh directory

Copy the content of the file id_rsa.pub into the file ~/.ssh/authorized_keys chmod 600 ~/.ssh/authorized_keys

You can also use ssh-copy-id to copy your public key to a remote host. A typical command is

ssh-copy-id youruser@example.com

From now on, no password will be asked when you will ssh to this server.

Advertisement

Imprint
Responsible for the content:
www.ctheroux.com
Privacy & Terms of Use:
www.ctheroux.com
Mobile website via:
WordPress AMP Plugin
Last AMPHTML update:
30.03.2024 - 16:14:38
Privacy-Data & cookie usage: