World-writable cron job or startup file
If a cron entry, systemd unit or startup script is writable by a non-root user, any local process can make it run code as root at the next tick — a classic persistence and privilege-escalation path.
Why it matters
Attackers who get a foothold look for exactly this: a scheduled task they can edit to run their payload with higher privileges and survive reboots.
The same applies to files cron and systemd execute — if the file is writable, its contents are too.
How to check for it
- Check permissions on /etc/cron*, /var/spool/cron, systemd unit files, rc.local and profile.d scripts — none should be group- or world-writable.
- find /etc/cron* /etc/systemd -perm -0002 -type f lists world-writable offenders.
How to fix it
- Set ownership to root and remove write for group/other (chmod o-w,g-w).
- Review what each job actually runs, and whether the binaries it calls are themselves writable.
SkyShield checks this automatically
Connect your AWS, Cloudflare, GitHub, GitLab, Hetzner or DigitalOcean account read-only and SkyShield flags this across every account and region, with the fix in plain words — alongside the agent that watches your servers. Start free.