Printer FriendlyEmail Article Link

UNIX: How do you configure scp on a server to not prompt for a password when transferring a file?

  • HP All Versions

client-machine% ssh-keygen -t rsa
client-machine% scp ~/.ssh/ user@target-machine:~/.ssh/authorized_keys2

  • Note that if you want to access target-machine from two or more "clients", you can not copy the to authorized_keys2 directly.
  • You will need to open authorized_keys2 and paste the from each client machine on it (or use the line below to append the content)

client-machine% cat ~/.ssh/ | ssh user@target-machine \
'cat >> .ssh/authorized_keys'

  • Now you can use ssh/scp without user/password information:

client-machine% ssh user@target-machine
client-machine% scp file user@target-machine:~/file

Product : UNIX