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 want to transfer lots of files/folders from Windows to Linux using Rsync. On linux server(destination), I want the file permission set to 644, and folder permission set to 755. If possible, I want the ownership set to root.root for all the files/folders. I have tried -p option, but it doesn't work. Thank you for any help.

share|improve this question
Try umask 022 before your copy. – BillThor Feb 10 '11 at 6:21
up vote 12 down vote accepted

You can set the perms using the --chmod parameter e.g.


will force the permissions to be set to 755 for Directories and 644 for Files.

share|improve this answer
Thanks. The folder seems change to 744(drwxr--r--). Anyway, I decide to change the permission after transfer. – garconcn Feb 11 '11 at 21:42
The --chmod also accepts octal mode numbers, which in my opinion is easier to visualize the permission given: --chmod=D2775,F664 – Fred Wuerges Apr 23 '14 at 18:47

The --chmod argument syntax mentioned in the above is not quite accurate. When you specify owner, group, or other, and don't precede it with a "D" or a "F", it will apply that to all types of files, and it will apply the last parameter it finds as the default. This would explain why your directories were coming out as 744, since the last parameter in the argument was og=r.

Try this instead:

share|improve this answer
This should be the correct answer. – MattiasF Dec 21 '15 at 9:12

The right answer not the first floor, the second floor was right


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.