- A unit without
User=runs as root; a separate account inUser=takes away the powers a service does not need. ProtectSystem=strict,ProtectHome=yesandNoNewPrivileges=yesclose the disk, home directories and privilege escalation without touching the code.systemd-analyze security <unit>scores the restrictions, and--threshold=Nis made for a check in a script.- A service with a narrow task gets one capability (
CAP_NET_BIND_SERVICE) instead of all of root's power. - lab-preview from the start of the lesson read
/etc/shadowonly because it ran as root:User=previewclosed that access off.
Step 6 of 6 · summary · 2 min
Summary
Found an inaccuracy? Report an error in the lesson