shivanshu@<host> ls -l hello.sh
-rw-r-xr-x 1 shivanshu users 63 Sep 7 17:34 hello.sh
So I am clearly the owner of the file. I am able to change normal permissions like r, w, x using chmod command. However, when I try to do setuid on this file, I get an error
shivanshu@<host> chmod u+s hello.sh
shivanshu@<host> chmod: changing permissions of 'hello.sh': Operation not permitted
Note that I tried it with sudo, as well as with other files like text files instead of .sh files.
Why is this happening? I cannot figure it out based on doing some google search
P.S. - Comment on stack overflow post told me to post here
findmnt
, such asfindmnt -T . -u
, to see the filesystem type and all mount options. Keep in mind /usr is not necessarily going to be the same mount or filesystem as your data directory, especially on a pre-configured work system.