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?