Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am setting up a backup server on which I want to run rsync over ssh to backup content on other servers every night. I would like to set up ssh keys to make it password-less, but I want to preserve ownership of files and permissions. There are a number of users on the server to be backed up which won't all exist on the backup server.

What would be the best way to do this? I guess the backup job will need to connect as root to , but I don't want to enable root ssh access on the servers.

thanks for any tips,


ps, all servers are running UBUNTU Server 12.04 LTS and are behind a university firewall.

share|improve this question

1 Answer 1

up vote 0 down vote accepted

You cannot. Linux REQUIRES you to have root access to save a file as any user other than yourself. The ONLY workaround is to tarball it and then transfer the tarball to the server.

share|improve this answer
As a side note, you can enable root access over ssh on the server so long as you set authorized_keys to only allow a specific command (rsync in this case). Use the command option in authorized_keys to set a specific key to only allow a specific command such as /usr/bin/rsync. However, due to the security of ssh keys, if they have access to the root keys, you've got bigger issues on hand. –  UtahJarhead Oct 9 '12 at 1:53

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.