chmod 2755 Permission Explained: setgid Executable or Directory

Octal
2755
Symbolic
rwxr-sr-x
Binary
111 101 101
Risk Level
Moderate

Summary: On directories, new files inherit the group.

Class Read (4) Write (2) Execute (1) Octal
Owner (u) 7
Group (g) 5
Others (o) 5
2755
rwxr-sr-x
Owner: read/write/execute · Group: read/execute · Others: read/execute
chmod 2755 filename
Moderate Runs with the group's privileges (on directories: new files inherit the group).
View the full chmod 2755 guide →
Advertisement

chmod 2755 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 2 — setgid (directory inherits group)

Is chmod 2755 Safe?

Moderate

When not to use it

Common Use Cases

chmod 2755 Command Examples

# Apply using octal mode
chmod 2755 filename

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

# Recursive command warning:
chmod -R 2755 /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 2755 {} +

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

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

umask Relationship

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

Advertisement

Frequently Asked Questions

What does chmod 2755 mean?

On directories, new files inherit the group. In octal notation, the owner receives 7 (read/write/execute), the group receives 5 (read/execute), and others receive 5 (read/execute).

Is chmod 2755 safe?

chmod 2755 is classified as Moderate. Runs with the group's privileges (on directories: new files inherit the group).

What is chmod 2755 in symbolic notation?

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

How is setgid different on files and directories?

On an executable file, setgid (chmod 2755) executes the binary with the effective group ID of the file group. On a directory, setgid alters file creation behavior: any new file or subfolder created inside automatically inherits the group of the parent directory rather than the primary group of the creating user.

Related Permissions

Change one bit:

Related Guides

Advertisement