Skip to content

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.

CtrlOpsFile System audit7 CHECKS
Checks in this audit
7
Rated high severity
3
Need root or sudo
4
Automated run time
~10s

Transcribed from the vps-security-filesystem audit script. For what the audit covers rather than how to fix it, see the File System checklist, or how the CtrlOps Security Audit runs.

Every check

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.

  1. 01World-Writable FilesSoonScans for world-writable files outside tmp directoriesSeverity: MEDIUMNeeds rootCan return FAIL · SKIP · PASS
  2. 02SUID/SGID FilesSoonChecks for set-id binaries, especially in user-writable pathsSeverity: HIGHNeeds rootCan return FAIL · PASS
  3. 03/tmp PermissionsSoonChecks that /tmp has the sticky bit set (1777)Severity: MEDIUMNo root neededCan return FAIL · SKIP · PASS
  4. 04System Log PermissionsSoonChecks that core system logs are not world-readableSeverity: MEDIUMNo root neededCan return WARN · PASS
  5. 05Empty Password AccountsSoonAccounts in /etc/shadow with no password setSeverity: HIGHNeeds rootCan return FAIL · SKIP · PASS
  6. 06Account File PermissionsSoonModes on the account databases: /etc/shadow, /etc/gshadow, /etc/passwd, /etc/groupSeverity: HIGHNo root neededCan return FAIL · WARN · PASS
  7. 07Unowned FilesSoonFiles left behind by a deleted user or groupSeverity: LOWNeeds rootCan return WARN · SKIP · PASS

Shared script behaviour

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.

The preamble

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.

Why checks skip

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.

rootThe audit runs as UID 0.Every privileged branch runs directly. No check skips for lack of permission.
nopasssudo -n true succeeds, so the account has passwordless sudo.Privileged commands run through sudo -n.
passA sudo password was supplied in the CtrlOps audit settings and accepted.Privileged commands run through sudo -S.
noneSKIPNone 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.

Keep going

FAQ

File System questions

Can't find your answer? Join Discord

  • No, 200 is the ceiling. The scan is piped through head -200, so any host at or past that limit reports the phrase rather than a number, and only the first three paths are shown as examples. The result is still actionable: fix what is listed, then re-run and see whether the count drops below the cap. On a Docker host a large share of these are usually image layer contents under /var/lib/docker, which the world-writable scan does not exclude even though the Unowned Files scan does.

  • It is, and this is a known false positive. The comparison is numeric, so a mode of 700 sorts above the expected 640 and trips the warning even though it grants nothing at all to group or other. Anything that is genuinely tighter, such as the 000 that RHEL ships, trips it the same way. The check also never looks at ownership, so the reverse case is possible too: 640 root:users passes while every local member of that group can read the hashes.

  • Not blindly. /tmp and /var/tmp are already excluded from the scan, so anything reported sits outside the directories where world-writable is legitimate, but the list still mixes real findings with container image layers under /var/lib/docker, where changing modes on the host corrupts the layer. Identify what owns each path with dpkg -S or rpm -qf before touching it, and fix the deployment that created the mode rather than the file, because a chmod -R 777 in a deploy script will simply put it back on the next release.

Stop juggling tools. Start managing fleets.

PuTTY
Termius
MobaXterm
WinSCP
SecureCRT
Royal TS
Warp
CtrlOps14 tools left
Webmin
aaPanel
RunCloud
Dokploy
IP spreadsheet
bash (2)
sticky notes

One app. All your servers. No context switching. Free to start, free to leave.

Start instantly · No credit card · Cancel anytime

Your privacy preferences. We use product analytics to improve CtrlOps. Google Analytics cookies and live chat stay off until you allow them. Cookie policy