Home > Documentation > Tips and Tricks > AUTOMATIC scp without using a password

AUTOMATIC scp without using a password

Posted by peter on January 31, 2012

LOCAL machine = the computer that needs to “scp” to or from the REMOTE machine

REMOTE machine = the computer that needs to give automatic access to the LOCAL machine

1. Generate on your LOCAL machine a keypair with: ssh-keygen -t rsa (dont type in any password, just keep hitting enter)

 ssh-keygen -t rsa

2. Copy content of the “~/.ssh/id_rsa.pub” file into the file “authorized_keys” (create if needed, otherwise add to end of the file) in the “/home/<usertoconnectas>/.ssh/” on the REMOTE machine which you want to automatically logon to. If you have to create the file, make sure that the user under whos .ssh folder it is, has rights to it

3. Make sure the authorized_keys on the REMOTE machine is not read or modifiable by group or others my doing chmod 700 /home/<usertoconnectas>/.ssh/authorized_keys

4. Make sure the .ssh directory on the REMOTE machine is not read or modifiable by group or others my doing chmod 700 /home/<usertoconnectas>/.ssh

5. Edit the “/etc/ssh/sshd_config” on the REMOTE machine and make sure the following is set:

PasswordAuthentication yes

PermitEmptyPasswords yes

6. Restart SSH Daemon on REMOTE machine with the following command:

service sshd restart

 

Comments:

Leave a Reply



(Your email will not be publicly displayed.)

Please type the letters and numbers shown in the image.Captcha CodeClick the image to see another captcha.