<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Linux-Security on LinuxHosted.com</title><link>https://www.linuxhosted.com/tags/linux-security/</link><description>Recent content in Linux-Security on LinuxHosted.com</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>LinuxHosted.com</copyright><lastBuildDate>Tue, 20 Oct 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://www.linuxhosted.com/tags/linux-security/index.xml" rel="self" type="application/rss+xml"/><item><title>Harden a systemd Service: ProtectSystem and NoNewPrivileges</title><link>https://www.linuxhosted.com/post/harden-systemd-service-ten-directives-protectsystem-nonewprivileges-friends/</link><pubDate>Tue, 20 Oct 2026 00:00:00 +0000</pubDate><guid>https://www.linuxhosted.com/post/harden-systemd-service-ten-directives-protectsystem-nonewprivileges-friends/</guid><description>
&lt;p&gt;Run &lt;code&gt;systemd-analyze security&lt;/code&gt; against two ordinary services on the same host and the scores can land almost six points apart — one near UNSAFE, the other down close to OK — without either service being broken or badly written. On a stock Ubuntu box running systemd 259, &lt;code&gt;cron.service&lt;/code&gt; measures 9.6 UNSAFE while &lt;code&gt;chrony.service&lt;/code&gt; measures 3.7 OK, per &lt;a href="https://bulwark.nrl.ai/articles/systemd-service-sandboxing"&gt;Bulwark's directive-by-directive sandboxing guide&lt;/a&gt;. The gap isn't about code quality — cron genuinely needs broad access to run arbitrary jobs as arbitrary users, while Debian and Ubuntu ship chrony's unit file with a static non-root user, &lt;code&gt;ProtectSystem=strict&lt;/code&gt;, and most of its Linux capabilities already stripped. Every systemd service inherits whatever the handful of directives in its &lt;code&gt;[Service]&lt;/code&gt; block grant it, and by default that's close to everything the host can do. This guide works through ten of those directives that do most of the real work, the supporting ones worth adding alongside them, and &lt;code&gt;systemd-analyze security&lt;/code&gt; as the way to confirm any of it actually moved the needle.&lt;/p&gt;</description></item></channel></rss>