Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am backing up a networked server via SSH. Unfortunately, I can't seem to figure out how to get root access to the networked server with Rsync. I am using the following command to perform the backup:

sudo rsync -av ubuntu@*******:/ /media/backup1/ubuntubackup

Some directories come up as permission denied. Once I log in through Rsync, the backup just starts and there is no way to issue the sudo command. I understand that I can use the Rsync daemon to get around this, but I would like to use SSH without the daemon for the sake of simplicity. Does anyone know a way to accomplish this? Any help would be greatly appreciated.

share|improve this question
Is this on Amazon Cloud? – user8290 Jan 1 '12 at 0:53
up vote 2 down vote accepted

I believe the issue is you are taking 'sudo' on the local box and not on the remote server. I have not verified this, but a structure like the following should work:

rsync -R -avz -e ssh --rsync-path="echo mypassword | \
    sudo rsync" /media/backup1/ubuntubackup ubuntu@*******:/ /media/backup1/ubuntubackup
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.