chmod 2755 (rwxr-sr-x)
Like 755, with setgid: files created inside a directory inherit the directory's group.
rwxr-sr-xWho can do what
| Read | Write | Execute | |
|---|---|---|---|
| Owner | ✓ | ✓ | ✓ |
| Group | ✓ | – | ✓ |
| Others | ✓ | – | ✓ |
- Owner can read, write and execute.
- Group can read and execute.
- Others can read and execute.
- setgid: the file runs with the group's privileges, and new files in a directory inherit its group.
Commands
Set the mode
chmod 2755 my-file # same thing in symbolic form: chmod u=rwx,g=rxs,o=rx my-file
In ls -l output, a file with this mode shows as -rwxr-sr-x and a directory as drwxr-sr-x.
Try a different mode
| Read | Write | Execute | Special | |
|---|---|---|---|---|
| Owner | ||||
| Group | ||||
| Others |
Octal Symbolic
Command