[Nix-dev] nixos service using privileged ports as a non-root user

Ganesh Sittampalam ganesh at earth.li
Thu Jun 4 23:05:22 CEST 2015


Hi,

I'm adding a service - darcsden - to NixOS that is designed to run as a
non-root user, but should optionally be able to bind to a privileged
port. It's not designed to start as root and then fork/drop privileges,
so I'd like to handle this at the OS level somehow.

I'm aware of various solutions:

http://unix.stackexchange.com/questions/10735/linux-allowing-an-user-to-listen-to-a-port-below-1024

http://stackoverflow.com/questions/413807/is-there-a-way-for-non-root-processes-to-bind-to-privileged-ports-1024-on-l

Is there any standard/preferred way to do this in NixOS?

Cheers,

Ganesh


More information about the nix-dev mailing list