What does chmod 700 mean? Private folder permissions explained

By TechCompare · Updated · How we check

chmod 700 sets permissions to rwx------, so the owner can read, write and enter, while group and others get nothing. Use it for a private folder, such as ~/.ssh.

Mode 700 is the owner-only folder setting. In ls -l, a folder with this mode shows as drwx------. The owner can enter it and work with the files inside, while everyone else can't even list the file names. It's the setting to reach for when a folder should stay out of other accounts' view.

Octal
700
chmod 700
Symbolic
rwx------
Owner / Group / Others
Category
Secure Permissions
Restricted access

How this is calculated

In octal, the owner's digit is 7, made from 4 + 2 + 1. The chmod(1) manual says a numeric mode comes from adding up the bit values. The group and others digits, 0 and 0, add up to nothing, so neither can read, write or enter.

On a folder, execute is the bit that lets you in, and read only lets you list the names. That's why 700 is the folder version of chmod 600. A folder at 600 gives the owner read and write but no execute, so the names can be listed while the files inside stay out of reach.

The ssh(1) manual says the recommended permissions for ~/.ssh/ are 'read/write/execute for the user, and not accessible by others.' A file can have 700 too. The owner then gets execute, so a script with a first line like #!/bin/bash can run as ./backup.sh, and only the owner can run it.

Verdict

Keep 700 for folders like ~/.ssh or a folder of personal notes, where no other account has any reason to look inside. For a private file that doesn't need to run, use 600 or 400 instead.

Don't use 700 when a web server or another account has to read the folder. Those accounts need read and enter, so chmod 755 fits, or 750 when they share a group with you. For a shared project folder, a group mode works better than 700.

Watch out for chmod -R 700 dir. The -R flag applies the mode to every file inside, so every file gets execute for the owner. Set the files to 600 instead with find ~/private -type f -exec chmod 600 {} +. The -type f part picks regular files only, so folders are left alone.

More CHMOD scenarios

Frequently asked questions

What does chmod 700 mean?
It gives the owner read, write and execute, shown as rwx------, and it gives the group and others no access at all. On a folder, execute is what lets the owner go inside.
What is the right permission for the .ssh folder?
Use chmod 700 ~/.ssh. The ssh(1) manual recommends that mode for the directory, so the owner has full access and the group and others get nothing. Private keys inside can use 600 or 400.
What's the difference between chmod 700 and 600?
Both give the owner read and write and leave the group and others out. The difference is execute. A 700 script can run directly, and a 700 folder can be entered. A 600 folder can't be entered, so its files stay out of reach even for the owner.
Why does ls fail with 'Permission denied' in someone else's 700 folder?
The folder gives your account no read and no execute. Read is what lets ls list the names, and execute is what lets you enter, so both fail. You can't change the mode yourself, so ask the owner to open access, for example with 750 and a shared group, or to send you copies of the files.