[systemd-devel] Is there a reason to run systemd Units with root access?

Michael Chapman mike at very.puzzling.org
Thu Jul 6 10:22:52 UTC 2017


On Wed, 5 Jul 2017, Mariusz Wojcik wrote:
> Hi,
>
> I’m just asking because of the latest “not-a-bug” [1]. As far as I know, 
> there aren’t many services that need full root access (maybe for getting 
> a low port number). Except for that I don’t see many use cases. 
> Therefore, I think it would be useful to make the decision for root 
> access more explicit, e.g. User=root is needed to start units as root. 
> Also I don’t think it is a sane default is to start any unit as root 
> when there is no valid User property. Even the security of systemd would 
> benefit because it would save people from accidentally running services 
> as root.

Making User= mandatory would be a backwards-incompatible change, and break 
a *lot* of existing units. People understand that omitting Unit= on a 
system unit means the unit runs as root, just as omitting it on a user 
unit means the unit runs as that user. Breaking units that work perfectly 
well right now and do exactly what the admin wanted them to do really 
isn't an option.


More information about the systemd-devel mailing list