Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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

This question already has an answer here:

I encountered the error when attempting to transfer source files from a remote Linux web server to a local HP dt1000i Desktop Hard Drive connected to an Ubuntu 12.10 box via USB.

A Samba share is configured for the HP drive to enable the Windows machines on my LAN to access the files. Samba was set up using the built-in graphical folder sharing functionality within Ubuntu. I can modify the files fine in Windows, but problems occur using rsync.

When the error occurred, I was trying to use rsync to backup files from my web space to the HP drive. I executed the rsync command in PuTTY from a Windows 8 machine on my LAN:

rsync -avz --progress --partial -e 'ssh -p 2222' user@www.example.com:/home/user/ /media/HPDesktopDrive/Backup/HostGator/

This resulted in the following error: rsync: failed to set permissions on "/path/to/file.txt": Operation not permitted (1).

I thought the source of the error was the mount options for the HP drive in the /etc/fstab file: both the user_id and group_id options were set to zero so I tried change them to 1000 as per the advice in NAS box mounted via CIFS - problem with permissions.

An ls -la of the Samba share reports that the user and group are recursively set to root:root. I tried to address this by executing sudo chown -R mike:mike /media/HPDesktopDrive/, but the files are still set to root:root.

What is the correct command to change the permissions from my Windows machine via PuTTY and will this address the problem?

share|improve this question

marked as duplicate by slm, Anthon, jasonwryan, rahmu, Renan Feb 4 '14 at 23:52

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Related: unix.stackexchange.com/questions/10044/… – slm Feb 4 '14 at 19:55

Chances are, this falls into one of the following:

  • There is an ACL that the webhost supports, which the Samba drive does not support.
  • You are rsync'ing files from the webhost to the Samba share as a user, which does not have rights to chown files.
  • A mounted filesystem will not necessarily allow all permissions/acl/ownership details to be available for change.

As for the Samba share, you may need to setup the share to allow for unique ownership of files, which may mean a need to add additional accounts to HP unit.

share|improve this answer
Thanks for your reply. For what it's worth, the problem was caused by incorrect syntax in the /etc/fstab file: user_id and group_id as opposed to uid and gid. The drive is now mounted with mike:mike permissions and the problem is resolved. – unpossible Apr 14 '13 at 10:14
Nice. Glad you found the root cause! – Wing Tang Wong Apr 15 '13 at 4:51

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