I was in the processs of learning a bit about the special permission in Linux. Where is find certain anomilies.

suid - For executable/files where user subsume the UID/permission of the owner. With UID range ~1-100.

sgid - For directories - GID, where GID is subsumed and any file and or subdirtory holds the permission of original group instead of the creator's group.

However when I apply the permission using chmod +s test, the system applies a blanket permission over both owner and group irrespective of the file type.

I know the representations is same for both s but shouldn't that be applied judiciously with file type in mind?

For e.g :- I created a normal file test and applied the aforementioned command. What surprises me is despite being a normal file type the command is also applied on the group side as well.

~$ chmod +s test
~$ ls -l test
-rwSr-sr-x 1 shashwat shashwat 0 Jan 27 13:14 test
~$ file test
test: setuid, setgid, empty

Is that normal? What kind of repercussion can occur from that kind file permission?


  • I think your description of suid and sgid are wrong. – 炸鱼薯条德里克 Jan 27 at 8:35
  • 1
    Use g+s or u+s then. – Kusalananda Jan 27 at 11:03
  • @Kusalananda That was insightful, I didn't knew I can do that. – Shashwat Jan 28 at 3:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.