This question already has an answer here:

I'm running scp command between two machine i.e, A( and b(

When I'm running command from A(

sudo scp success.tar.gz remote@

it keep asking me for password for remote user

What should I do in order to execute the scp command without entering password?

marked as duplicate by xhienne, αғsнιη, Stephen Rauch, Romeo Ninov, Jeff Schaller Aug 22 '17 at 13:31

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    1. Is there any reason to use sudo? 2. Did you add your public key in authorized_keys on host B? – Romeo Ninov Aug 22 '17 at 13:02
  • use either ssh keys or you can use a utility called sshpass. "sshpass -p 'password' scp file.tar.gz root@xxx.xxx.xxx.194:/backup" – Indy Bains Aug 22 '17 at 13:16

Browse other questions tagged or ask your own question.