Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I want to grant a single user write permissions to a directory owned by root over command line. With chmod, it seems that I can only change the permissions for owner, group and other, not for a specific user.

share|improve this question

2 Answers 2

up vote 5 down vote accepted

If you mount the filesystem with the "acl" option (add it to /etc/fstab), you can use setfacl:

setfacl -m u:USERNAME:r FILENAME

would give user USERNAME read access to FILENAME.

share|improve this answer
    
Remember to install acl package. –  enzotib Sep 25 '11 at 8:43

By default in Ubuntu every user belongs to a group with the same name, i.e. hannesh:hannesh.

You can make the folder owned by root:hannesh, and give it permissions like 770 though I see no reason for it to be owned by root if you want the user to be able to write there - why doesn't hannesh:hannesh suit you? Root would be able to write in that folder anyway.

Also have a read about the sticky bit if root creates files in that directory which need to be writeable by the user.

share|improve this answer

Your Answer

 
discard

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.