DevOps Engineer
chmod for DevOps engineers: 755, 644, 600, and the permissions that matter
Last updated 2026-06-24
Use 755 for scripts and directories, 644 for configs and static files, 600 for SSH keys and secrets. Never use 777 in production. These three values cover most everyday permission decisions.
CHMOD Configurator
Octal Notation
Symbolic Notation
Command Line Example
DevOps engineers reach for chmod daily in Dockerfiles, CI/CD pipelines, and server provisioning scripts. The three permissions that cover most cases: 755 for executable scripts and directories, 644 for config files and static assets, and 600 for SSH private keys and secrets.
Why this matters for you
In a Dockerfile, RUN chmod 755 /entrypoint.sh is the usual way to make an entrypoint executable. Config files mounted into containers should be 644 so the app can read them but not accidentally overwrite them. SSH refuses to use a private key that others can access and throws a 'permissions too open' error, so set keys to 600 or stricter. Avoid 777 in production. It lets any user change the file, and audits flag it.
Reading the three digits
Each digit adds up read (4), write (2) and execute (1). The first digit is the owner, the second is the group, and the third is everyone else. So 755 gives the owner 7 (4 + 2 + 1, all three) and everyone else 5 (4 + 1, read and execute). 644 gives the owner read and write and everyone else read only. 600 locks the file to its owner.
Execute means something else on a directory. It lets a user enter the directory and reach the files inside. A directory set to 644 shows its file names to others but won't let them open anything, which is why web roots and app folders use 755.
Defaults, containers and Git
New files get their mode from your umask. The common default of 022 removes write access for group and others, so new files start at 644 and new directories at 755. With BuildKit, COPY --chmod=755 in a Dockerfile sets the mode while copying, which saves a separate RUN chmod layer.
Check who owns the file, too. A 600 key owned by root can't be read by an app that runs as a non-root user. Git only stores the execute bit, so a script committed as 100755 checks out executable and other mode changes are ignored. If a script loses its execute bit in CI, run git update-index --chmod=+x on it and commit.
Verdict
Start with 755, 644 or 600 depending on whether the file runs, gets read, or holds a secret. Use 777 only as a last resort, since it lets any user change the file.