Blueprints · Server Hardening
Beginner
10 min · Linux
Default umask 027
Stages a login.defs umask so new files are not world-readable. Existing files are left as they are.
Baked-in protections
- New files are not world-readable
- Existing permissions are not rewritten
- The file is staged
Step 1 · conf
login.defs snippet
/root/portgate-blueprints/login-defs-umask.txt
Set UMASK 027 in /etc/login.defs after you confirm application installs still work.
UMASK 027
Step 2 · bash
Read-only check
/root/portgate-blueprints/umask-check.sh
Prints status. It does not change the service.
#!/bin/sh set -eu umask grep -E '^UMASK' /etc/login.defs || echo "UMASK is not set in login.defs."