Slackware HowTo

Manage SUID, SGID, and capabilities on Slackware

Reduce excessive privileges and understand which binaries run with special powers.

1. When to use it

Useful for periodic audits or after software installs that may introduce binaries more permissive than necessary.

SUID | SGID | getcap | permissions audit | least privilege

2. Base setup

find / -xdev \( -perm -4000 -o -perm -2000 \) -type f 2>/dev/null
getcap -r / 2>/dev/null
chmod u-s /usr/local/bin/oldtool

Adjust host names, IPs, interfaces, paths, and versions to the real system before making the change persistent.

3. Quick verification

find /usr/local/bin -perm -4000 -type f
getcap /usr/bin/ping
stat /usr/local/bin/oldtool

Confirm that the output matches the expected state before considering the intervention complete.

4. Operational notes

When a program supports capabilities, prefer them over full SUID: the damage radius is smaller.

Quick checklist

[ ] Steps completed\n[ ] Config updated\n[ ] Tests executed\n[ ] Rollback ready\n[ ] Logs checked

Back to Linux HowTo