I work in security, but I'm not a Linux admin at least not the best one. For a while now I've been using Claude Code directly on my production web server (Ubuntu, Apache, PHP, Postgres). It deploys the app, hardens the server, reads logs and changes WAF/firewall rules. Honestly it does a better job than I would alone, and much faster. This is for personal projects I do myself, not client, so apologies if its not the right thread place.
The server itself is locked down quite a lot. SSH only from my dedicated static IP, key + Duo push, password login off. Web ports only accept traffic from Cloudflare (with mTLS origin pulls), everything else is dropped. On top of that WAF with OWASP CRS, CrowdSec, AppArmor, snapshots before bigger changes, nightly encrypted offsite backups and automatic rollback when a config change breaks the site.
But the agent itself runs as root and doesn't ask before each command. So the outside is closed, and the risk sits inside. It reads config files with DB passwords and API keys (which go to the provider), and it reads WAF logs, which are basically text written by attackers...
So questions to people who have tried this themselves, and would apprechiate your outputs:
- Would you recommend it on production?
- Did anything go wrong for you, any security concerns I'm not seeing?
Thanks.