Owner (User)


Group


Public (Others)


rwxr-xr-x
chmod 755 file.sh

Standard Linux Production Permission Presets

OctalSymbolicRecommended Use
755rwxr-xr-xDirectories, CGI/shell scripts, compiled binaries
644rw-r--r--Static HTML/CSS/JS, nginx configs, regular documents
640rw-r-----App config files shared only with a specific service group
600rw-------Private SSH keys (~/.ssh/id_ed25519), database credentials, .env secrets
400r--------AWS/cloud PEM keys that should never be edited accidentally
777rwxrwxrwxAvoid in production — grants write & execute access to every local user

Each digit sums three permission bits: Read = 4, Write = 2, Execute = 1. For directories, the execute bit (+x) controls whether users are allowed to traverse into the folder.

Frequently Asked Questions

Why does OpenSSH reject a 644 private key?

OpenSSH requires private keys to be readable only by the owner (600 or 400) so other system accounts cannot copy your credentials.

Why do directories need 755 instead of 644?

On Linux/Unix, the execute bit on a directory grants permission to enter (cd) and access files inside it. Setting 644 on a folder blocks non-root users from opening files inside.

Is chmod 777 safe on a web server?

No. 777 allows any local process or user to modify or execute files. Use 755 for folders and 644 (or 640/600 for secrets) instead.

Production Linux File Permission Reference Table

OctalSymbolicRecommended Use
600-rw-------SSH private keys (id_ed25519), .env secrets
644-rw-r--r--Static web files, Nginx configs, source code
700drwx------~/.ssh directory, private backup folders
755drwxr-xr-xWeb root folders, executable CLI scripts

Avoid chmod 777 on servers—it grants world-writable execution to every local process and frequently breaks SSH key authentication. See our complete Linux Chmod & IPv4 CIDR Cheatsheet.

Frequently Asked Questions

Why does SSH reject my private key with Permissions are too open?
OpenSSH requires private keys to be unreadable by group and others. Run chmod 600 on the key file and chmod 700 on the ~/.ssh folder.
What does the execute bit (x) mean on a directory?
On directories, execute permission allows traversing (cd) into the folder and accessing files inside by name.
Why is chmod 777 dangerous in production?
It allows any user or compromised service account on the host to modify or replace scripts and configs.