I can't set other's setuid bit. Why? Is there some security lock?

$ ls -l                                                                              
-rwxrwxr-x  1 allexj allexj 16784 Mar 11 17:30 a.out                                                                                                       
$ chmod o=+s a.out                                                              
$ ls -l                                                                              
-rwxrwx---  1 allexj allexj 16784 Mar 11 17:30 a.out
  • 2
    Try to describe what you think  an “other's setuid bit” would/should/could do. Mar 11, 2022 at 19:03
  • Sorry you got downvoted. I am happy to see the wealth of knowledge shared in the answers and comments despite that. Mar 11, 2022 at 20:46

2 Answers 2


man chmod

There is a special section about setuid and setgid.

But first of all, just look closely at the names: setuid, setgid.

For others there should be setoid bit. But it does not exist, since it does not make a sense to have such a bit.

  • >"For others there should be setoid bit. But it does not exist, since it does not make a sense to have such a bit." Can you tell me why?
    – Allexj
    Mar 11, 2022 at 17:56
  • 5
    The setuid and setgid on executable is forcing that executable to be run with permissions of the owner-group of the file. Who should we switch the permissions to if it is 'set other id'?
    – White Owl
    Mar 11, 2022 at 18:22
  • thanks!! @White_Owl
    – Allexj
    Mar 11, 2022 at 21:31

Traditional Unix permissions consist of 12 bits

user   group  other  extra
0 0 0  0 0 0  0 0 0  0 0 0
r w x  r w x  r w x  s s t

Those extra bits allow you to enable three "additional models" [1]:

  • The first bit (usually depicted as a lowercase s letter) is the setuid bit which, when you run an executable with it, allows any user to have their EUID[2] set to the UID of the executable's owner.
  • The second bit (also depicted as a lowercase s letter) is the setgid bit, it has the same effects and implications as the setuid bit, but, unlike setuid, it works with groups and EGIDs effetively allowing any user to run an executable as if they had their group set to that of the file owner's group.
  • The last third bit is the sticky bit[3] (also called the restricted deletion flag). It's almost always used for directories and allows anyone to create a file in it and makes sure the files "stick" to their owner not allowing anyone (except for root) to remove them. On modern systems its most common use is with the /tmp directory. Everyone can create files inside on it and only them are allowed to remove them, this makes sure that everybody can share a directory while simultaneously guaranteeing that none of the users can mess with the other's files. For directories this bit has mostly the same behavior on most Unix (and Unix-like) systems. It's use for files, however, is not uniform across different Unix (and Unix-like) systems, and, for example, modern Linux kernels completely ignore it and other systems may have some special uses[4]

So, now that we know how these bits operate on modern systems, ask yourself a question: If the 12-th bit was not dedicated to the aforementioned behaviors, what would setuid bit's behavior look like if we applied it to the "other" users? With setuid and setgit it's obvious, but what does it mean to "allow any user to have their effective user ID as any other user's ID"? To me it looks like a division by zero, it makes no logical sense as the answer could be "the effective user ID would be any and all of the other possible user IDs at the same time". There are no security locks or implications, it just doesn't make any sense to have such a thing. And the original Unix designers probably didn't see much sense in having such a silly thing and decided to find a better application for it (they could also just use 11 bits for permissions, but I like to think that they actually figured they needed all 12 as they could use it for something helpful, which they also eneded up doing. Also working with even number of bits is easier).

Hope this helps.

  • thanks!!!!!!!!!
    – Allexj
    Mar 11, 2022 at 21:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .