Change file ownership by being a sudoer

109 views Asked by At

let's say that we have this situation :

-rwxrwx-w- 1 user1 mygroup  0 Sep 12 16:53 testfile

Can a sudoer change this file ownership ? does he have to be a sudoer on command chown or on file ?

1

There are 1 answers

8
Am_I_Helpful On

I missed the point that the ownership of any file in the system may only be altered by a super-user.

The 2nd set of rwx shows that any user who is a member of mygroup can read, write and execute this file.

So, if the user user2 is a super-user (present in sudoers and have sufficient permissions), he can make the necessary changes. If not, then he / she can't modify the ownership!