Interview Prep/Linux/Processes, services and systemd

The service you created must bind to port 443, but it runs as a non-root user. How?

BeginnerScenarioProcesses, services and systemd
Answer

Situation read → Ports below 1024 need CAP_NET_BIND_SERVICE.

What I'd do → Add to the [Service] section:

AmbientCapabilities=CAP_NET_BIND_SERVICE
CapabilityBoundingSet=CAP_NET_BIND_SERVICE

Then daemon-reload and restart. Alternatives: put nginx in front on 443 and proxy to a high port, or use socket activation.

Why → You grant one privilege instead of running the whole app as root.

Interview tip → Mention sysctl net.ipv4.ip_unprivileged_port_start exists but it is a host-wide change.

All Linux questions Roadmap: Linux

More on Processes, services and systemd