Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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. –  edvinas.me Jun 11 at 7:10
    
@edvinas.me: Or by being in the file's ACL. –  grawity Jun 11 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 at 7:19

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.