Super User is a question and answer site for computer enthusiasts and power users. 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

So I have a file:

-rw-rw-rw- 1 joe web 35046982 Nov  4 16:54 app.log

I am in web group:

[sam@proj log]$ id
uid=5067(sam) gid=5071(sam) groups=505(web),5071(sam)

But I can't change the permissions:

[sam@proj log]$ chmod 777 app.log 
chmod: changing permissions of `app.log': Operation not permitted

More background:

This is for a deployment script. Many users can run it with their own user and they all need to be able to do stuff like adding write permissions to log file. I thought assigning the file to a group and then adding all users to that group would work.

What am I doing wrong?

share|improve this question

Only privileged users (root) can chown a file. At most, if you're the owner of the file you can change its group with chgrp.

From the chown man page

Only the root user can change the owner of a file. You can change the group of a file only if you are a root user or if you own the file. If you own the file but are not a root user, you can change the group only to a group of which you are a member.

share|improve this answer

I think that only privileged users can change permission of files that doesn't belong to them. In your case, you are not joe and you are not a privileged user, so you can't change file permissions.

share|improve this answer
What does "privileged user" mean? – Pawel Decowski Nov 4 '09 at 17:28
It means a user which can do anything on the system, root for example. – danadam Nov 4 '09 at 17:45

What filesystem is this on? Is this a network share? is this on NFS? Im guessing its on NFS, so chekc your export options and make sure you're exporting with full permissions to that group id...

share|improve this answer
It's ext3. What are "export options" and how do I export with full permissions to a group ID? – Pawel Decowski Nov 4 '09 at 17:31
The export options Sidhu is referring to are NFS( export options. The only way I know of to export full permissions are to give it full permissions on the host. – Kevin M Nov 4 '09 at 18:00

You must log in to answer this question.