Jenkins execute shell scp

Solution 1:

echo 'password' | sudo -S scp ...

no, it is not a good idea and it does not work, as discussed many times around SE. SSH flushes input before reading password. You should set up ssh keys.

If keys are not an option, there is also tool called sshpass, which you can use to provide password to ssh/scp. The last possibility is expect script, which can interact with interactive prompts.