chmod 4755 — rwsr-xr-x

4755 = rwsr-xr-x: setuid executable.

Updated

4755
Octal
rwsr-xr-x
Symbolic
Risky
Security

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.

WhoDigitSymbolicPermissions
Owner (user)7rwxread, write, execute
Group5r-xread, execute
Others5r-xread, 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.

Chmod calculatorToggle read, write and execute for owner, group and others to build any permission.
Open the calculator

Frequently asked questions

What does chmod 4755 do?
It sets the permissions to rwsr-xr-x: the owner gets read, write, execute, the group read, execute and others read, execute.
What is 4755 in symbolic notation?
rwsr-xr-x, or chmod u=rwx,g=rx,o=rx as a symbolic chmod command.
Is chmod 4755 safe?
Generally no. 4755 adds a setuid bit, a privilege-escalation risk if the program has bugs; prefer a narrower permission.