Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

First, why can't I do this?

% id -un
% ls -l
-rw-rw-r--+ bob bob 100 today foo
% chmod +x foo
chmod: changing permissions of `foo': Operation not permitted
% getfacl foo
# file: foo
# owner: bob
# group: bob

I do have the ability, but chmod just doesn't want to do it. This works, for example:

% cp foo bar
% mv bar foo
% chmod +x foo

With the additional side effect that the file owner is now me. (Which is file.) Is this really the shortest way to accomplish this?

(The slightly shorter version,

% cp foo foo

to take ownership also doesn't work. If I absolutely can't chmod a file I don't own, is there a way to "take ownership" that doesn't involve a complete I/O of the file?)

share|improve this question

It is simple: the security model does not allow it. unless your operating system has a change_acl permission only the owner of a file or the superuser can make changes to the acl. the way around this if you have the permissions is to take ownership of the file, change the permissions, and give the file back. typically on unix systems the only one that can give or take ownership of a file is root, but as you found a way that works for taking ownership of a file is to copy the file, so that you own the copy, and replace the original with the copy you own. but now it is yours. also look at sudo it works wonderfully in for this.

share|improve this answer

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.