The Complete OpenSSH & Credential File Checklist for chmod 600
chmod 600 (-rw-------) gives only the owning user read and write access, blocking both group members and other system users completely. OpenSSH, PostgreSQL psql (~/.pgpass), cURL (~/.netrc), and Ansible vaults all explicitly check stat(2) mode bits at runtime and abort with a security error if group or world bits are non-zero.
Keep this exact OpenSSH permission map handy: set ~/.ssh itself to 700 (directories need execute bit to traverse), private keys (id_ed25519, id_rsa), ~/.ssh/config, and ~/.ssh/authorized_keys to 600, and public keys (*.pub) to 644. Never apply chmod 600 to a directory, or you will lose the ability to cd into it.
Strict CLI ChecksRequired by OpenSSH, PostgreSQL ~/.pgpass, curl ~/.netrc, and Docker secrets
Why does SSH say "Bad owner or permissions on ~/.ssh/config"?
OpenSSH refuses ~/.ssh/config if it is group-writable or world-writable (often caused by umask 0002). Run chmod 600 ~/.ssh/config to fix it immediately.
What is the difference between chmod 600 and chmod 400?
chmod 600 (-rw-------) lets the owner read and edit the file, while chmod 400 (-r--------) makes it read-only even for the owner. Both satisfy OpenSSH for private keys.
Should I use chmod 600 on ~/.ssh directory?
No! Directories require the execute bit to access files inside them. Use chmod 700 ~/.ssh for the directory and chmod 600 ~/.ssh/id_ed25519 for files inside it.