Friday, February 11, 2011

Cygwin: Setting up a trusted ssh-relationship

If you are frequently connecting via ssh to the same server or if you are using rsync to backup your files as will be described in a later guide, you might want to set up a trusted relationship between your local computer and the remote server.

Start by generating a private/public key set.
Run the following command:
$ ssh-keygen -t rsa

Now go to your local .ssh folder.
Then download the "authorized_keys" file from the server
scp user@server.com:/home/user/.ssh/authorized_keys .
then make a backup copy of the file:
$ cp authorized_keys authorized_keys.backup
now merge public key id_rsa.pub into the authorized_keys file
$ cat authorized_keys id_rsa.pub
and upload the authorized_keys file to the server
$ scp authorized_keys user@server.com:/home/user/.ssh

Now try and connect via ssh:
$ ssh user@server.com
It should now not prompt for password.

No comments:

Post a Comment