devkult_
tools29converters34

chmod 660

rw-rw----Safe when used as intended

Owner and group can read and write; others have no access.

660 lets the owner and the group read and write, and hides the file from everyone else. It suits files that two cooperating accounts — say, an app and its worker — both need to update, but that nobody else should see.

Permission by permission

WhoReadWriteExecuteDigitMeans
owner✓✓—6read and write
group✓✓—6read and write
others———0no permissions
  • In ls -l: -rw-rw---- for a file, drw-rw---- for a directory.
  • Symbolic form: u=rw,g=rw,o=
  • New files get this mode when the umask is 006.

Use it for

  • Shared data or state files between services in one group.
  • Unix sockets meant for a specific group (database and app sockets often use it).

Avoid it for

  • Files only one account uses: 600 is tighter.
  • Files the group should only read: 640.

Commands

chmod 660 path

set this mode on a file or directory

chmod u=rw,g=rw,o= path

the same, written symbolically

find path -type f -exec chmod 660 {} +

apply it to every file in a tree, leaving the directories alone

stat -c '%a %A %n' path

check the current mode on Linux (macOS: stat -f '%Lp %Sp %N' path)

Try variations

660
-rw-rw----
WhoreadwriteexecuteDigit
owner6
group6
others0

The owner can read and write; the group can read and write; everyone else can do nothing.

chmod 660 file
chmod u=rw,g=rw,o= file

Read the full guide to chmod 660 →

Frequently asked questions

660 vs 640?

660 lets the group write; 640 lets it only read. Grant group write only when the group really modifies the file.

Related modes