chmod 4755 Permission Explained: setuid Executable

Octal
4755
Symbolic
rwsr-xr-x
Binary
111 101 101
Risk Level
High Risk

Summary: Runs with the file owner's privileges.

Class Read (4) Write (2) Execute (1) Octal
Owner (u) 7
Group (g) 5
Others (o) 5
4755
rwsr-xr-x
Owner: read/write/execute · Group: read/execute · Others: read/execute
chmod 4755 filename
High Risk Runs with the file owner's privileges. A bug in this program can lead to privilege escalation.
View the full chmod 4755 guide →
Advertisement

chmod 4755 Breakdown

Class Digit Symbolic On a file On a directory
Owner (u) 7 rwx Full access Full access: list, enter, create, delete
Group (g) 5 r-x Read and execute Can list and enter
Others (o) 5 r-x Read and execute Can list and enter
Special 4 — setuid (runs with owner privileges)

Is chmod 4755 Safe?

High Risk

When not to use it

Common Use Cases

chmod 4755 Command Examples

# Apply using octal mode
chmod 4755 filename

# Apply using equivalent symbolic mode
chmod u=rwx,g=rx,o=rx,u+s filename

# Recursive command warning:
chmod -R 4755 /path/to/dir
# Note: -R applies the same mode to files and directories. Use find to treat them separately:
find /path/to/dir -type d -exec chmod 4755 {} +

# Verify permissions
stat -c '%a %A %n' filename    # Linux
stat -f '%Lp %Sp %N' filename   # macOS

# Example ls -l output:
-rwsr-xr-x 1 alice staff 1024 Jan 15 10:00 example.txt

umask Relationship

A umask of 022 makes new directories 4755. Test umask values with our interactive Umask Calculator.

Advertisement

Frequently Asked Questions

What does chmod 4755 mean?

Runs with the file owner's privileges. In octal notation, the owner receives 7 (read/write/execute), the group receives 5 (read/execute), and others receive 5 (read/execute).

Is chmod 4755 safe?

chmod 4755 is classified as High Risk. Runs with the file owner's privileges. A bug in this program can lead to privilege escalation.

What is chmod 4755 in symbolic notation?

In symbolic notation, chmod 4755 is represented as rwsr-xr-x. You can apply this permission using the equivalent symbolic command "chmod u=rwx,g=rx,o=rx,u+s filename".

What is the security risk of setuid?

When an executable has the setuid bit (chmod 4755), it executes with the permissions of the file owner (often root) regardless of who launches it. If the executable contains a security flaw, vulnerability, or environment variable bug, an unprivileged local user can exploit it to spawn an interactive shell with root privileges.

Related Permissions

Change one bit:

Related Guides

Advertisement