chmod 6755 Permission Explained: setuid + setgid Executable
Summary: Runs with both the owner's and the group's privileges.
| Class | Read (4) | Write (2) | Execute (1) | Octal |
|---|---|---|---|---|
| Owner (u) | 7 | |||
| Group (g) | 5 | |||
| Others (o) | 5 |
chmod 6755 filename
chmod 6755 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 | 6 |
— | setuid (runs with owner privileges), setgid (directory inherits group) | |
Is chmod 6755 Safe?
High Risk
- Runs with the file owner's privileges. A bug in this program can lead to privilege escalation.
- 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 modern production applications, web services, and custom scripts
Common Use Cases
- Rare legacy system tools and diagnostics that require both root user and specialized group access
- Security audit training and privilege escalation testing lab environments
chmod 6755 Command Examples
# Apply using octal mode
chmod 6755 filename
# Apply using equivalent symbolic mode
chmod u=rwx,g=rx,o=rx,u+s,g+s filename
# Recursive command warning:
chmod -R 6755 /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 6755 {} +
# Verify permissions
stat -c '%a %A %n' filename # Linux
stat -f '%Lp %Sp %N' filename # macOS
# Example ls -l output:
-rwsr-sr-x 1 alice staff 1024 Jan 15 10:00 example.txt
umask Relationship
A umask of 022 makes new directories 6755. Test umask values with our interactive Umask Calculator.
Frequently Asked Questions
What does chmod 6755 mean?
Runs with both the owner's and the group'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 6755 safe?
chmod 6755 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 6755 in symbolic notation?
In symbolic notation, chmod 6755 is represented as rwsr-sr-x. You can apply this permission using the equivalent symbolic command "chmod u=rwx,g=rx,o=rx,u+s,g+s filename".
How do I find setuid and setgid files on my system?
You can discover all setuid and setgid binaries across your Linux system using the find command: "find / -perm /6000 -type f -exec ls -la {} + 2>/dev/null". Security auditors run this command periodically to detect unauthorized setuid executables that could provide attackers with privilege escalation pathways.
Related Permissions
Change one bit: