Jeffrey Winn's Blog

Assorted thoughts and information of nominal value

View on GitHub

If you want to SSH into a host without a password, follow this short guide.

Note that this will be a one-way transaction; you can only go from Host A to Host B, unless of course you follow this procedure and swap the devices.

First, generate a pair of authentication keys on Host A without using a password:

ssh-keygen -t rsa

…next, still on Host A, use SSH to create a directory, which may already exist, on Host B. You must use the password this time:

ssh foo@b mkdir -p ~/.ssh

…next, and again on Host A, append the key from Host A you generated to the appropriate file on Host B:

cat ~/.ssh/id_rsa.pub | ssh foo@b 'cat >> .ssh/authorized_keys'

At this point, you should be able to SSH from Host A as the example user ‘foo’ (or whatever username you used) to Host B.

…Get back