Ubuntu Passwordless and Public Key Authentication

1. Need to generate a local public key file from client machine

# ssh-keygen -t dsa 

( from client machine)

2. Copy the file to the server

# scp ~/.ssh/id_dsa.pub user@linuxfreaks.in:/home/user

3. Login to the server and add the key to authorized_keys file

# cat id_dsa.pub >> .ssh/authorized_keys

4. Delete the original file you copied

# rm -r id_dsa.pub

All done, now just ssh to the server. It will login without the password.

Note : Passwordless authentication is a big security risk.

Leave a Reply

Your email address will not be published. Required fields are marked *