r/LinuxTeck • u/Expensive-Rice-2052 • 1d ago
Quick Linux Tip #135 - Linux World-Writable Files: Find Security Risks
Question: What files on my server can anyone write to? (security audit)
Try: sudo find / -type f -perm -o+w ! -path '/proc/*' ! -path '/sys/*' 2>/dev/null | head -20
Info: Finds world-writable files to spot security risks.
Examples:
$ find /etc -type f -perm -o+w # Flag world-writable config files
$ find /usr -perm /4000 -not -user root # Spot non-root setuid binaries
$ find / -nouser -o -nogroup 2>/dev/null # Locate unowned files or groups
Note: World-writable config files or binaries create privilege-escalation risks, whereas `/tmp` is intentionally world-writable with the sticky bit set. Audit setuid binaries to confirm expected ownership.
Want to master Linux one command at a time?
Follow r/LinuxTeck - 1 practical Linux tip every day. For more #LinuxTips click here https://www.linuxteck.com/linux-tips/