SSH: login without a password
17/12/07 15:26 Filed in: Unix
WARNING: logging in without a password is highly convenient but anybody with access to your workstation with this enabled can log in to your server, so make sure your workstations is adequately secured!
First, on the client side create the private and public keys
This creates two files:
Note that the -N "" option tells ssh not to create a passphrase, and the -t option specifies the type as "rsa".
And second, upload the public key file (
If you get an error message then please make sure the
First, on the client side create the private and public keys
$ ssh-keygen -f $HOME/.ssh/id_rsa -N "" -t rsa
This creates two files:
id_rsa and id_rsa.pub in $HOME/.ssh. The file id_rsa is the private key, and the file id_rsa.pub is the public key.Note that the -N "" option tells ssh not to create a passphrase, and the -t option specifies the type as "rsa".
And second, upload the public key file (
id_rsa.pub) to the server and append it to the to the authorised keys file $ cat $HOME/.ssh/id_rsa.pub | ssh you@server 'cat - >> ~/.ssh/authorized_keys'
If you get an error message then please make sure the
~/.ssh directory exists on your server. |