Server Fault is a question and answer site for system and network administrators. 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'm moving from one VPS to another, and I figured that the simplest way to transfer data would be rsync.

However, the data is owned by a user, www-data, which doesn't have ssh privileges, and I'd like it to be owned by the same (named) user on the target machine. Obviously I need all file permissions preserved. I have SSH access via another user with sudo privileges on both machines.

Is this possible to do this with rsync?

share|improve this question
up vote 3 down vote accepted

why not rsync and chown afterwards? alternatively you can temporarily allow root logins to one of the machiens and run rsync.. if run as root - it'll preserve ownership.

share|improve this answer
as a side note, you can do PermitRootLogin without-password to enforce a key login, and then AllowUsers to restrict /which/ hosts you will allow root to login from. – cpbills Jun 6 '10 at 14:05
Thanks, it worked. – Leonid Shevtsov Jun 6 '10 at 17:03

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.