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

I'm running the latest version of Ubuntu, and have mounted a SMB share via a line in rc.local.

The share mounts correctly, and I can browse files freely, create new files, and then delete them without problems.

But when I try and rsync a directory onto the mounted share:

rsync -a --delete /MySource/ /SharedMountPoint/

I get lots of errors:

rsync: failed to set times on "/SharedMountPoint/SomeDir": Operation not permitted (1)

and similar errors about being unable to create temp files.

All the files and directories on the share are listed with numeric uid/guid - which I suppose is reasonable, as they were originally created via a sync from a windows box.

I have no great need for access control - its just a box on a LAN that me and my family use as a dropbox - I'd basically just like anyone to be able to access it (provided they've done basic authentication).

share|improve this question
up vote 4 down vote accepted

When mounting, use -o uid=youruid. Then, all files on that cifs share will be owned by you so that you can edit/remove them.

mount -o uid=1000 //nas/share /SharedMountPoint

You can find your numeric uid in /etc/passwd

grep `whoami` /etc/passwd | cut -d : -f 3


id -u `whoami`
share|improve this answer
Ahh - that did it. I did try setting the uid in the mount, but I thought it had to be the uid associated with the target files. Thanks – Visage Dec 30 '11 at 10:31

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.