What does chmod 600 mean? Private key permissions for SSH and secrets
By TechCompare · Updated · How we check
chmod 600 gives -rw------- in ls -l: the owner can read and write, while the group and others get no access. Use it for SSH keys and other secrets.
chmod 600 shows as -rw------- in an ls -l listing: only the owner can read and write the file. The group and everyone else get no access at all. This is a common default for SSH private keys. Mode 400 is also valid when the owner only needs read access. OpenSSH rejects user-owned private keys accessible by group or others.
How this is calculated
In octal, 6 = 4+2+0 (read+write) for the owner, and the zeroes for group and others mean no permissions whatsoever. 600 is the usual mode for anything containing secrets: SSH keys, GPG private keys, database credential files, API token files. The principle is least privilege. Many applications will warn or refuse to run if their config files are world-readable and contain passwords.
Verdict
Use 600 for SSH keys and any other file that only its owner should touch. The octal sets the owner bits to 6 (4+2, read+write) and zeroes out group and others. Mode 400 is stricter.
SSH enforces restrictive permissions on private keys because a key readable by group or others could be copied by another account. The same principle applies to other credential stores: .env files with API tokens, AWS credentials under ~/.aws/, kubeconfig under ~/.kube/, and GPG secret keys.
Choose the narrowest mode that still lets the application work.
More CHMOD scenarios
Related guides
Frequently asked questions
Why does SSH reject my key with 'permissions are too open'?
How do I fix 'Bad permissions' on my SSH private key?
chmod 600 ~/.ssh/id_rsa (or whichever key filename). SSH enforces that private keys must not be readable by group or others when the file is owned by the invoking user. If your key mode is 644 (readable by all) or 666, SSH refuses to use it. Ownership and filesystem access still need to be correct, but a different owner is not the same permission check as group or other read access.What other secret files should be chmod 600?
.env files with API tokens or database passwords, GPG private keys (~/.gnupg/*.gpg), AWS credentials (~/.aws/credentials), kubeconfig files (~/.kube/config), and .htpasswd files. The principle is least privilege: if only one user or process needs access, restrict the file to that user with mode 600.Related tools
Subnet Calculator
Calculate network address, broadcast address, and usable IP ranges for IPv4/IPv6.
Use toolJSON Formatter
Validate, format, and minify JSON. Browse it as a tree, run JSONPath queries, compare two documents, or validate against a JSON Schema.
Use toolUnix Timestamp
Convert between Unix timestamps and human-readable dates.
Use tool