chmod 4755 (rwsr-xr-x)
Like 755, with setuid: the program runs with its owner's privileges. /usr/bin/passwd uses this to update /etc/shadow.
rwsr-xr-xWho can do what
| Read | Write | Execute | |
|---|---|---|---|
| Owner | ✓ | ✓ | ✓ |
| Group | ✓ | – | ✓ |
| Others | ✓ | – | ✓ |
- Owner can read, write and execute.
- Group can read and execute.
- Others can read and execute.
- setuid: the file runs with the owner's privileges.
Commands
Set the mode
chmod 4755 my-file # same thing in symbolic form: chmod u=rwxs,g=rx,o=rx my-file
In ls -l output, a file with this mode shows as -rwsr-xr-x and a directory as drwsr-xr-x.
Try a different mode
| Read | Write | Execute | Special | |
|---|---|---|---|---|
| Owner | ||||
| Group | ||||
| Others |
Octal Symbolic
Command