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

In Linux system, assume that there is user 'A' (non-root user who has ssh login permission).

'A' owns an executable file "A.out".

I want to allow 'A' to read/execute "A.out"

However, I don't want 'A' to change permission of "A.out"

as a root user, how can I enforce this?(in Ubuntu server)

thank you in advance.

share|improve this question
up vote 3 down vote accepted

The only two ways you can enforce this are:

  1. Change the file's owner to root or another user.

  2. Use SELinux/AppArmor/SMACK to deny the chmod usage.

share|improve this answer
Just to add, when/if you do change file's owner to root, make sure that "userA" has read-only access to file by being in group-owner group of file. – phoops Jun 11 '14 at 7:10 Or by being in the file's ACL. – grawity Jun 11 '14 at 7:12
it seems that if the owner of 'A.out' is root and group of 'A.out' is 'A' and if I give the permission of 'A.out' ---r-x---, it works as I want. A can RX the file 'A.out' but cannot change the permission. Am i right? – daehee Jun 11 '14 at 7:19

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.