chmod 666
rw-rw-rw-Dangerous — avoid on real systems
Everyone can read and write; nobody can execute.
666 gives every user read and write access, with no execute bit. Any account or process on the system can change or empty the file.
Linux uses it for device files that must be universally usable — /dev/null and /dev/zero are crw-rw-rw- — but for ordinary files it's rarely right.
Permission by permission
| Who | Read | Write | Execute | Digit | Means |
|---|---|---|---|---|---|
| owner | ✓ | ✓ | — | 6 | read and write |
| group | ✓ | ✓ | — | 6 | read and write |
| others | ✓ | ✓ | — | 6 | read and write |
- In
ls -l:-rw-rw-rw-for a file,drw-rw-rw-for a directory. - Symbolic form:
u=rw,g=rw,o=rw - New files get this mode when the umask is
000.
Use it for
- Device files and similar special cases that genuinely must be writable by all.
Avoid it for
- Config files, logs and data — anyone could tamper with them. Use
644, or664with a shared group. - Upload targets on web servers.
Commands
chmod 666 path
set this mode on a file or directory
chmod u=rw,g=rw,o=rw path
the same, written symbolically
find path -type f -exec chmod 666 {} +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
| Who | read | write | execute | Digit |
|---|---|---|---|---|
| owner | 6 | |||
| group | 6 | |||
| others | 6 |
The owner can read and write; the group can read and write; everyone else can read and write.
chmod 666 file
chmod u=rw,g=rw,o=rw file
Frequently asked questions
Is 666 safer than 777?
Slightly — it can't be executed directly — but anyone can still change the contents. A script with 666 could be modified by any user and then run by someone who trusts it.