DEV Community

Cover image for Login to the server without password
Mohammad Reza
Mohammad Reza

Posted on

Login to the server without password

That is a very nice way if you want to dont write your password for every login to the server :)

cd ~/.ssh
ls
Enter fullscreen mode Exit fullscreen mode

If you have "id_rsa.pub" you dont need to generate it but if you dont have it lets make it

ssh-keygen -o -t rsa -C "azibom@gmail.com"
Enter fullscreen mode Exit fullscreen mode

Now you should see it in ~/.ssh
Lets copy it

cat ~/.ssh/id_rsa.pub
Enter fullscreen mode Exit fullscreen mode

Then you need to login to the server and add this key to the remote server
Run this command

nano .ssh/authorized_keys
Enter fullscreen mode Exit fullscreen mode

And paste what you copied at the end of this file
And now you have login to the server without password :)

Top comments (0)