Header image

Daemons Should Run As Unprivileged Users

A webserver daemon is primarily there to serve up data to a user. It might dynamically look up data, e.g. from a database, but aside from logs it doesn't usually generate data. So why should it have permission to create files? Remember, if it's cracked, it belongs to the bad guys, not you. Why make things easy for them?

Servers should not run as root if it can possibly be avoided. Many servers need to run as root if they will run on the privileged ports (below 1024) but even that can be worked around if they are behind a firewall. Put the webserver on port 8080 (running as, say, 'nobody'), then have the firewall forward external port-80 traffic to the webserver...

[Prev]   [Up]   [Next]