Syngin
09-14-2005, 10:59 AM
How to set up a secure copy without a password:
Let us assume that you are setting up a secure copy tunnel between 2 machines: local and remote. The first thing to do is ensure that ssh and openssl are installed. For our purpose, the local machine is the machine doing the copying to the remote host.
Local machine setup:
1. cd into the .ssh directory in your users home directory (ie. cd /home/syngin/.ssh)(If this directory doesn’t exist yet, try ssh-ing into the remote host from the command line and it should be created for you)
2. ssh-keygen –t rsa (This might ask some strange questions. Be sure to choose no passphrase. Two files will be created: id_rsa and id_rsa.pub)
3. scp id_rsa.pub user@remote-host.com:.ssh/authorized_keys (This will copy your public key to the remote host)(You may be prompted for the remote user’s password)
4. Test for success: ssh user@remote-host.com You should now be logged in without a password.
Remember that this is valid for user to user only so make sure you set up any automated copying in the specific user’s crontab.
Anyone have any additions to this or error corrections? I've done this on both Redhat and Debian servers.
Let us assume that you are setting up a secure copy tunnel between 2 machines: local and remote. The first thing to do is ensure that ssh and openssl are installed. For our purpose, the local machine is the machine doing the copying to the remote host.
Local machine setup:
1. cd into the .ssh directory in your users home directory (ie. cd /home/syngin/.ssh)(If this directory doesn’t exist yet, try ssh-ing into the remote host from the command line and it should be created for you)
2. ssh-keygen –t rsa (This might ask some strange questions. Be sure to choose no passphrase. Two files will be created: id_rsa and id_rsa.pub)
3. scp id_rsa.pub user@remote-host.com:.ssh/authorized_keys (This will copy your public key to the remote host)(You may be prompted for the remote user’s password)
4. Test for success: ssh user@remote-host.com You should now be logged in without a password.
Remember that this is valid for user to user only so make sure you set up any automated copying in the specific user’s crontab.
Anyone have any additions to this or error corrections? I've done this on both Redhat and Debian servers.