chmod 2755 Permission Explained: setgid Executable or Directory
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 |
chmod 2755 filename
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
- Runs with the group's privileges (on directories: new files inherit the group).
- Any user can read this file — never use it for secrets such as keys or .env files.
When not to use it
- Standard personal home folders or single-user directory trees
Common Use Cases
- Shared group utility commands and shared collaboration directories
- System tools that write to group-restricted spool directories like mail or print queues
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.
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: