<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>gwen</title>
    <link>https://blog.emma.coop/gwen/</link>
    <description></description>
    <pubDate>Thu, 16 Apr 2026 06:48:43 +0000</pubDate>
    <item>
      <title>Limited Sudo Access for Specific Users</title>
      <link>https://blog.emma.coop/gwen/limited-sudo-access-for-specific-users</link>
      <description>&lt;![CDATA[I&#39;m gonna start this blog with a softball I happened upon in Stack Overflow today. This snippet will give a user on a linux system password-free sudo permission but for a specific command(s).&#xA;&#xA;In my case I want a little side project to be able to reload nginx&#39;s config but I very much do not want a hacky side project running with complete sudo access.&#xA;This snippet is perfect as I can allow that user sudo access but only for this one task!&#xA;&#xA;Process&#xA;&#xA;Add a line like this to /etc/sudoers or /etc/sudoers.d/{user} &#xA;username ALL=(ALL) NOPASSWD: /path/to/command arguments, /path/to/another/command&#xA;Now log in as that user either via ssh or sudo su {user} and try your command.&#xA;$ systemctl reload nginx&#xA;&#xA;Examples&#xA;This will allow the user gwen to reload nginx but nothing else&#xA;gwen ALL=(ALL) NOPASSWD: /usr/bin/systemctl reload nginx&#xA;And this will allow the user gwen to reload or restart nginx but nothing else&#xA;gwen ALL=(ALL) NOPASSWD: /usr/bin/systemctl reload nginx, /usr/bin/systemctl restart nginx&#xA;&#xA;Credit for the solution goes to the original stack overflow post!&#xA;&#xA;#sudo #linux #sysadmin&#xA;&#xA;---&#xD;&#xA;About The Author&#xD;&#xA;Gwen is a Creative Technologist, livecoder, and founding member at the EMMA Technology Cooperative. She is also the designated server witch, and admin of this very writefreely instance.]]&gt;</description>
      <content:encoded><![CDATA[<p>I&#39;m gonna start this blog with a softball I happened upon in Stack Overflow today. This snippet will give a user on a linux system password-free sudo permission but for a specific command(s).</p>

<p>In my case I want a <a href="https://mygit.link/gwen/mygit-pages" rel="nofollow">little side project</a> to be able to reload nginx&#39;s config but I very much <strong>do not</strong> want a hacky side project running with complete sudo access.
This snippet is perfect as I can allow that user sudo access but only for this one task!</p>

<h2 id="process">Process</h2>

<p>Add a line like this to <code>/etc/sudoers</code> or <code>/etc/sudoers.d/{user}</code></p>

<pre><code>username ALL=(ALL) NOPASSWD: /path/to/command arguments, /path/to/another/command
</code></pre>

<p>Now log in as that user either via ssh or <code>sudo su {user}</code> and try your command.</p>

<pre><code class="language-bash">$ systemctl reload nginx
</code></pre>

<h4 id="examples">Examples</h4>

<p>This will allow the user gwen to reload nginx but nothing else</p>

<pre><code>gwen ALL=(ALL) NOPASSWD: /usr/bin/systemctl reload nginx
</code></pre>

<p>And this will allow the user gwen to reload <strong>or</strong> restart nginx but nothing else</p>

<pre><code>gwen ALL=(ALL) NOPASSWD: /usr/bin/systemctl reload nginx, /usr/bin/systemctl restart nginx
</code></pre>

<p>Credit for the solution goes to <a href="https://stackoverflow.com/questions/21830644/non-privileged-non-root-user-to-start-or-restart-webserver-server-such-as-ngin/22014769#22014769" rel="nofollow">the original stack overflow post!</a></p>

<p><a href="/read/t/sudo" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">sudo</span></a> <a href="/read/t/linux" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">linux</span></a> <a href="/read/t/sysadmin" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">sysadmin</span></a></p>

<hr>

<h4 id="about-the-author">About The Author</h4>

<p><a href="https://gwenpri.me" rel="nofollow">Gwen</a> is a Creative Technologist, livecoder, and founding member at the EMMA Technology Cooperative. She is also the designated server witch, and admin of this very writefreely instance.</p>
]]></content:encoded>
      <guid>https://blog.emma.coop/gwen/limited-sudo-access-for-specific-users</guid>
      <pubDate>Sat, 28 Aug 2021 21:13:59 +0000</pubDate>
    </item>
    <item>
      <title>Test blog, do not read</title>
      <link>https://blog.emma.coop/gwen/test-blog-do-not-read</link>
      <description>&lt;![CDATA[I told you not to....&#xA;&#xA;---&#xD;&#xA;About The Author&#xD;&#xA;Gwen is a Creative Technologist, livecoder, and founding member at the EMMA Technology Cooperative. She is also the designated server witch, and admin of this very writefreely instance.]]&gt;</description>
      <content:encoded><![CDATA[<p>I told you not to....</p>

<hr>

<h4 id="about-the-author">About The Author</h4>

<p><a href="https://gwenpri.me" rel="nofollow">Gwen</a> is a Creative Technologist, livecoder, and founding member at the EMMA Technology Cooperative. She is also the designated server witch, and admin of this very writefreely instance.</p>
]]></content:encoded>
      <guid>https://blog.emma.coop/gwen/test-blog-do-not-read</guid>
      <pubDate>Thu, 26 Aug 2021 17:05:07 +0000</pubDate>
    </item>
  </channel>
</rss>