# chmod 4755 — What It Means & When to Use It

> 755 plus setuid: the program runs with its owner's privileges. Symbolic: `rwsr-xr-x` · Use with care.

4755 is 755 with the setuid bit. When anyone runs the file, it executes with the privileges of the file's owner rather than the user who started it. In `ls -l` the owner's x becomes an s: `rwsr-xr-x`.

That's how `passwd` (owned by root) can update `/etc/shadow` for an ordinary user, and how `sudo` works. It's also why setuid-root binaries are a favourite target for privilege escalation.

## Permission by permission

| Who | Permissions |
|---|---|
| owner | read, write and execute |
| group | read and execute |
| others | read and execute |

Symbolic chmod argument: `u=rwx,g=rx,o=rx,u+s`

## Use it for

- System programs that must act with elevated rights on a user's behalf, such as `passwd` and `sudo`.

## Avoid it for

- Your own scripts: Linux ignores setuid on interpreted scripts, and setuid binaries you write are a security liability.
- Prefer narrowly scoped alternatives: `sudo` rules or Linux capabilities (`setcap`).

## FAQ

### What does the s in rwsr-xr-x mean?

The setuid bit is set and the owner can execute. A capital S means setuid is set but the owner's execute bit isn't — usually a mistake.

### How do I find setuid files on a system?

Run find / -perm -4000 -type f 2>/dev/null. Review the list: unexpected entries are a classic sign of compromise.

## Related modes

- [chmod 755](https://www.devkult.com/chmod/755.md): Owner can do everything; group and others can read and execute
- [chmod 2775](https://www.devkult.com/chmod/2775.md): 775 plus setgid: new files inherit the directory's group
- [chmod 1777](https://www.devkult.com/chmod/1777.md): 777 plus the sticky bit: anyone can create, only owners can delete

Open the interactive page: https://www.devkult.com/chmod/4755