What does chmod 4755 mean?
chmod 4755 gives setuid executable. The setuid bit (4) makes the program run with the file owner’s privileges — for example /usr/bin/passwd runs as root so it can update /etc/shadow. A setuid root binary with a bug is a privilege-escalation risk; never set it on scripts.
| Who | Digit | Symbolic | Permissions |
|---|---|---|---|
| Owner (user) | 7 | rwx | read, write, execute |
| Group | 5 | r-x | read, execute |
| Others | 5 | r-x | read, execute |
Each digit is the sum of read (4), write (2) and execute (1). In ls -l the file shows as -rwsr-xr-x and a directory as drwsr-xr-x.
The special bit
The leading 4 sets setuid (4). In ls -l it shows as s in the owner’s execute position.
How to use chmod 4755
# one file or directory
chmod 4755 filename
# the same permissions in symbolic form
chmod u=rwx,g=rx,o=rx filename
# a directory and everything inside it
chmod -R 4755 directory/
Security warning
Setuid programs run with their owner’s privileges. Only trusted, audited binaries should carry the setuid bit — audit with find / -perm -4000 -type f.
Need a different combination? Tick the boxes in the chmod calculator to get the octal and symbolic values instantly.
Frequently asked questions
What does chmod 4755 do?
What is 4755 in symbolic notation?
rwsr-xr-x, or chmod u=rwx,g=rx,o=rx as a symbolic chmod command.