SSH login without password

This is one of the things every command line geek needs every once in a while. Note that you should never do this on a public computer. If you have not generated an RSA key yet, do it with this command:

ssh-keygen -t rsa

You can decide whether to use a password or not. Then, display the key with

cat ~/.ssh/

Copy the key to clipboard and log in with ssh to your server you want to have passwordless. On the remote server, run

nano ~/.ssh/authorized_keys

Paste the key to that file and save it (in nano it’s CTRL+O and to quit use CTRL+X). If you prefer vim, use it instead of nano. If .ssh directory cannot be found, create it with mkdir ~/.ssh and edit the authorized_keys as above.

After this, you can ssh into the machine without having to type a password.

Want to write with me?

Do you know something about tech, nerdy stuff, movies, code, AI, Internet phenomena, social media or anything related to geeky subjects? Join and write with me! I'm currently doing this alone and my time is not sufficient for upkeeping the blog by myself, so all pieces of articles are welcome. Contact me and get your user account.

Roni Laukkarinen

Roni Laukkarinen

Editor-in-chief and owner of Geeky Lifestyle blog. Truly a jack of all trades, a Swiss knife; an avid tech and multimedia geek, coder, owner of a digital agency company, sysadmin, music enthusiast, artist and film critic.

Leave a Reply

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

Follow The Geek

Geeky Lifestyle is a huge tweeter! Follow @thatgeekyblog to get real-time updates about what's happening in the scene.