Possible duplicate of scp to remote server with sudo
I'm facing the following issue:
- A folder (with sub-folders) with files belonging to
- I login with another user
sudo -u usr1
- How can I copy the whole folder to another Linux box over ssh?
I tried the following with no success:
sudo -u usr1 tar cf - * | ssh usr2@host 'cd /tmp/dump; sudo -u usr1 tar xf -'
Any help would be appreciated