chmod 2775

chmod 2775 gives rwxrwsr-x. Like 775, and new files inherit the directory's group (setgid). Keeps a shared team directory's group consistent.

  • Free
  • No Sign-Up
  • Runs in Your Browser

Owner

Group

Others

Permissions

rwxrwsr-x

Command

chmod 2775 file

Chmod Calculator

chmod 2775 explained

Octal2775
Symbolicrwxrwsr-x
Ownerread, write, execute
Groupread, write, execute
Othersread, execute
Special Bitssetgid
ls -l Shows-rwxrwsr-x
Commandchmod 2775 file
Symbolic Commandchmod u=rwx,g=rwx,o=rx file

Each digit of 775 is one class of user and adds up read (4), write (2) and execute (1). 7 for the owner is read, write, execute; 7 for the group is read, write, execute; 5 for the others is read, execute.

Like 775, and new files inherit the directory's group (setgid). Keeps a shared team directory's group consistent.

On a directory, execute means permission to enter it and reach files inside; read means permission to list it. That is why directories usually have execute wherever they have read.

Questions

What does chmod 2775 mean?
Owner: read, write, execute. Group: read, write, execute. Others: read, execute. The leading 2 adds setgid. In letters: rwxrwsr-x.
Is chmod 2775 safe?
Yes, for the uses described here. Nobody outside the classes given write access can change the file.
How do I apply 2775 to every directory but not files?
find /path -type d -exec chmod 2775 {} + (and use -type f for files only).
How do I set 2775 recursively?
chmod -R 2775 /path. Be careful: this gives files and directories the same mode, which is rarely what you want; the find command above is safer.

Run servers for other people?

Frabs stops the abuse their VMs send out, and keeps your network off blocklists.