Cygwin SSH Pre Shared Keys and Putty

On the Cygwin machine:

Generate SSH keys, since we’re going for password less logins, just hit enter on the prompts for passphrase:

cd ~
ssh-keygen.exe -t rsa

Copy the key to the remote machine:

scp ~/.ssh/id_rsa.pub username@remotemachine:/home/username/id_rsa.pub

On the remote machine:

Move the key and set permissions:

mkdir ~/.ssh
mv ~/id_rsa.pub ~/.ssh/authorized_keys
chown -R username:username /home/username/.ssh
chmod 700 /home/username/.ssh
chmod 600 /home/username/.ssh/authorized_keys

You should now be able to login to the remote machine without a passphrase:

ssh username@remotemachine

I’ve also found it handy to use Putty to run CygWin. There is a modified version of Putty called PuTTYcyg available at google code that you can use to launch Cygwin, as described in the PuTTYcyg FAQ here.

0 comments ↓

There are no comments yet...Kick things off by filling out the form below.

Leave a Comment