How to make ssh into server without password


This is mostly needed by beginner network admin which login into several server from their laptop / PC and inserting password each login. We can avoid this inserting password by using public keys. Now, go to client and generate public key by :

1
ssh-keygen -t rsa


Then you need to copy your public key to server by :

1
scp ~/.ssh/id_rsa.pub <username>@<you-server-host-or-ip>:<your-folder-path>/id_rsa_client.pub

Then, login into server. In this cases, I use use “ubuntu” for username and “/home/ubuntu” as default home path. Also, I assume “id_rsa_laptop.pub” located in “/home/ubuntu”.

1
2
3
cd ~/
mkdir .ssh
cat id_rsa_laptop.pub > .ssh/authorized_keys2

Done! Just it! Now you can login into your server without inserting password 🙂


Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.