chmod 770 rwxrwx---

chmod 770 (rwxrwx---): the owner can read, write and execute, the group read, write and execute, others do nothing. Typical use: shared team directories.

Octal
770 (also written 0770)
Symbolic
rwxrwx---
ls -l shows
-rwxrwx--- for a file, drwxrwx--- for a directory
chmod letters
u=rwx,g=rwx,o=

Who can do what

ClassDigitBitsOn a fileOn a directory
Owner (u)7rwxRead the contents, change or empty the contents and run it as a programList the names inside, create, delete and rename entries and enter it and open files by name
Group (g)7rwxRead the contents, change or empty the contents and run it as a programList the names inside, create, delete and rename entries and enter it and open files by name
Others (o)0---NothingNothing

Each digit adds read (4), write (2) and execute (1). Deleting or renaming a file depends on write and execute on the directory that holds it, not on the file's own mode. Root bypasses read and write checks.

Typical uses

The owner and the group have full access, others get nothing. A shared project or upload directory for a team; add the setgid bit (2770) so new files keep the directory's group.

Security notes

  • The group can write, so check who is in the group; adding a user to it gives them write access.

Commands

  • Numeric
    chmod 770 file
  • Symbolic
    chmod u=rwx,g=rwx,o= file
  • Check the result
    stat -c '%a %A %n' file
  • Directories only, recursively
    find /path -type d -exec chmod 770 {} +

Avoid chmod -R 770 on a tree that holds files as well as folders: it makes every file executable. Use the find command above for directories and a file mode such as 660 for the files.

The umask that gives 770

  • umask 007: new directories are created as 770 (and files as 660)

Programs create files with 666 and directories with 777, and the umask removes bits from those. A umask never adds execute to a new file, and it cannot set setuid, setgid or the sticky bit.

Its file counterpart is chmod 660 (rw-rw----).

Other common modes

Work out any other mode in the chmod calculator