PortGate

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

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."