VPS & Server audit fixes
File System: fixing all 7 checks
The file system audit walks every local disk for the modes that turn an ordinary local account into root: world-writable files, set-id binaries, blank passwords and loose shadow permissions.
Three checks skip without root and they are the expensive ones: the two whole-disk scans, World-Writable Files and Unowned Files, plus Empty Password Accounts, which has to read /etc/shadow. SUID/SGID Files is also marked as needing root but never skips, it falls back to a partial scan and says so in the result, and /tmp Permissions skips only in the rare case that stat /tmp returns nothing at all.
Transcribed from the vps-security-filesystem audit script. For what the audit covers rather than how to fix it, see the File System checklist.
Find your finding
Listed in the order the audit runs them. Take the check name from the third field of the result line and open its page.
World-Writable Files
SoonScans for world-writable files outside tmp directories
MediumNeeds root3 resultsSUID/SGID Files
SoonChecks for set-id binaries, especially in user-writable paths
HighNeeds root2 results/tmp Permissions
SoonChecks that /tmp has the sticky bit set (1777)
MediumNo root3 resultsSystem Log Permissions
SoonChecks that core system logs are not world-readable
MediumNo root2 resultsEmpty Password Accounts
SoonAccounts in /etc/shadow with no password set
HighNeeds root3 resultsAccount File Permissions
SoonModes on the account databases: /etc/shadow, /etc/gshadow, /etc/passwd, /etc/group
HighNo root3 resultsUnowned Files
SoonFiles left behind by a deleted user or group
LowNeeds root3 results
How the File System audit reads your server
Every check in this audit runs after the same preamble, and several of its results only make sense once you know what that preamble could and could not see.
Three checks scan "every local filesystem": they read /proc/mounts for ext2/3/4, xfs, btrfs, jfs, f2fs, reiserfs mount points and run find <mounts> -xdev. This deliberately includes separate /home, /var, /srv partitions that a plain find / -xdev would skip. Network filesystems (NFS, CIFS), overlayfs and tmpfs are excluded.
A SKIP is never a pass
A skipped check verified nothing at all. The most common cause is privilege: 4 of the 7 checks in this audit need root for a complete result. Before every run, each script works out which of four privilege modes it is in.
| Mode | How it is reached | What it means for your results |
|---|---|---|
root | The audit runs as UID 0. | Every privileged branch runs directly. No check skips for lack of permission. |
nopass | sudo -n true succeeds, so the account has passwordless sudo. | Privileged commands run through sudo -n. |
pass | A sudo password was supplied in the CtrlOps audit settings and accepted. | Privileged commands run through sudo -S. |
none | None of the above worked. | CAN_ROOT=0. Every privileged branch returns SKIP with a "Need root" message rather than guessing. |
If many checks skip with a “need root” message, run the audit as root, grant the audit account sudo (with or without NOPASSWD), or supply the sudo password in the CtrlOps audit settings.
File System questions
Run all 7 File System checks, in one click
CtrlOps runs this audit over your existing SSH connection - no agents, no scripts to manage. $7/user/month after a 1 month free trial - no credit card required.
✓ Start instantly·✓ No credit card·✓ No sneaky autorenewals