devkult_
tools29converters34
home/chmod/1777

chmod 1777

rwxrwxrwtUse with care

777 plus the sticky bit: anyone can create, only owners can delete.

1777 is 777 with the sticky bit set on a directory. Anyone can create files in it, but a file can only be renamed or deleted by its owner, the directory's owner, or root. In ls -l the last x becomes a t: rwxrwxrwt.

It's the mode of /tmp and /var/tmp, and the correct mode for any world-writable shared directory.

Permission by permission

WhoReadWriteExecuteDigitMeans
owner✓✓✓7read, write and execute
group✓✓✓7read, write and execute
others✓✓✓7read, write and execute
  • In ls -l: -rwxrwxrwt for a file, drwxrwxrwt for a directory.
  • Symbolic form: u=rwx,g=rwx,o=rwx,+t
  • New directories get this mode when the umask is 000.

Use it for

  • /tmp-style directories that every user writes to.
  • Shared drop folders where users must not delete each other's files.

Avoid it for

  • Anywhere a narrower group would do: a group-owned 2775 directory is easier to reason about.
  • Remember files created inside still get their creator's umask — the sticky bit only controls deletion.

Commands

chmod 1777 path

set this mode on a file or directory

chmod u=rwx,g=rwx,o=rwx,+t path

the same, written symbolically

find path -type d -exec chmod 1777 {} +

apply it to every directory in a tree, leaving the files alone

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

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

Try variations

1777
-rwxrwxrwt
WhoreadwriteexecuteDigit
owner7
group7
others7

The owner can read, write and execute; the group can read, write and execute; everyone else can read, write and execute. Special: only owners can delete their own entries (sticky).

chmod 1777 file
chmod u=rwx,g=rwx,o=rwx,+t file

Read the full guide to chmod 1777 →

Frequently asked questions

What does the t in drwxrwxrwt mean?

The sticky bit. On a directory, it limits deleting and renaming entries to their owners. A capital T means sticky is set but others' execute isn't.

How do I fix /tmp permissions?

Run chmod 1777 /tmp as root. Many programs fail or refuse to start when /tmp isn't world-writable with the sticky bit.

Related modes