Geoff Garbers

Husband. Programmer. Tinkerer.

SSH into a Linux machine without entering a password

Feb 10, 2012

It’s annoying having to copy & paste a password every time you want to log into your favourite Linux machine. Thankfully, it’s quite easy to set up SSH keys between two Linux machines.

Here’s a quick little process that I do when I know I’ll be either using a certain machine a lot, or when I need to rsync between two machines in an automatic fashion.

Please note: it is not the most secure of methods, and anyone that gains access to your machine will be able to access those machines you have authenticated with. I can’t take any responsibility for anything untoward that comes as a result of this.

$ ssh-keygen -t dsa -f /tmp/key # (Leave a blank passphrase)
$ ssh-copy-id -i /tmp/key.pub [email protected]
$ rm /tmp/key /tmp/key.pub</pre>

And that should be it. Next time you attempt to log into [email protected], you’ll be logged in straight away, without any prompt for a password. This works on most Linux distributions.