Tuesday, May 7, 2024
 Popular · Latest · Hot · Upcoming
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 1313  / 2 Years ago, thu, february 10, 2022, 5:13:23

I know rwx = 7 in absolute permissions or numerical/octal representation of the permissions.


But what number is used to represent permission rws? (where the s is the set-uid bit that tells execution to happen with the privileges of the file owner).


For example: rwxrwsr--


I have never heard of anything higher that 777 so perhaps is there not a numerical representation for this?


Additionally, is it possible to have the set-uid bit in both user and group (ex. rwsrwsr--)? And if so what would be the numerical representation for this?


More From » permissions

 Answers
6

The special modes can be set numerically (octal) with a prefix like this:



The setuid bit is set with 4000 e.g: "chmod 4755 file".




The setgid bit is set with 2000 e.g: "chmod 2755 file".




The sticky bit is set with 1000 e.g: "chmod 1755 file".



So setting a setuid bit only on a file with "777" permissions is done like this:


chmod 4777 file

Reference: Permissions Calculator.


[#739] Friday, February 11, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
terose

Total Points: 185
Total Questions: 125
Total Answers: 131

Location: Venezuela
Member since Mon, Dec 13, 2021
2 Years ago
;