<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Sudo on Linux Security</title><link>https://linuxtransfer.com/tags/sudo/</link><description>Recent content in Sudo on Linux Security</description><generator>Hugo</generator><language>en</language><lastBuildDate>Fri, 09 Oct 2026 11:54:11 +0200</lastBuildDate><atom:link href="https://linuxtransfer.com/tags/sudo/index.xml" rel="self" type="application/rss+xml"/><item><title>Launch a temporary root process with `systemd‑run` instead of `sudo`</title><link>https://linuxtransfer.com/post/2026-10-09-launch-a-temporary-root-process-withsystemdru/</link><pubDate>Fri, 09 Oct 2026 11:54:11 +0200</pubDate><guid>https://linuxtransfer.com/post/2026-10-09-launch-a-temporary-root-process-withsystemdru/</guid><description>&lt;h2 id="run-a-single-command-as-root-with-systemdrun">Run a single command as root with &lt;code>systemd‑run&lt;/code>&lt;/h2>
&lt;p>When you just need to fire up one command as root and then drop back, &lt;code>sudo&lt;/code> is the go‑to.&lt;br>
But if your distro already runs systemd, &lt;code>systemd‑run&lt;/code> can be a leaner, more isolated way to do it—especially for short‑lived tasks.&lt;/p>
&lt;h3 id="what-systemdrun-actually-does">What &lt;code>systemd‑run&lt;/code> actually does&lt;/h3>
&lt;p>&lt;code>systemd‑run&lt;/code> spawns a transient unit (either a &lt;em>scope&lt;/em> or a &lt;em>service&lt;/em>) that inherits the caller’s privileges and then elevates them to root when you add &lt;code>--user&lt;/code> or &lt;code>--scope&lt;/code> with &lt;code>--user&lt;/code>.&lt;br>
Unlike &lt;code>sudo&lt;/code>, the unit vanishes as soon as the command finishes, and you can sprinkle a handful of systemd properties on it to tighten the environment.&lt;/p></description></item></channel></rss>