-1

This question already has an answer here:

Why does the command chmod 6754 correspond to the file permissions rwsr-sr-?

I understand that Read = 4, Write = 2, and Execute = 1, but what value does the s (setuid) permission or the dashes have?

marked as duplicate by jasonwryan, cas, John1024, jordanm, Michael Homer May 9 '16 at 2:52

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1

6754 sets the world, group, user, and UID bits on a file or directore, right-to-left. For the UID bits, they correspond to --s--s--s in a ls -l listing. That chmod is setting bits as follows:

6  --s--s---
7  rwx
5     r-x
4        r--

Since, by this metric, s overrides x, when these permissions are "summed up", you get rwsr-sr--.

0

From info '(coreutils)Numeric Modes':

           Special mode bits:
 1000      Restricted deletion flag or sticky bit
 2000      Set group ID on execution
 4000      Set user ID on execution

Not the answer you're looking for? Browse other questions tagged or ask your own question.