<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>NonRoot &amp;mdash; Paul Sutton</title>
    <link>https://personaljournal.ca/paulsutton/tag:NonRoot</link>
    <description>Personal Blog</description>
    <pubDate>Tue, 05 May 2026 17:51:34 +0000</pubDate>
    <item>
      <title>Bash scripting 19 – checking user is root</title>
      <link>https://personaljournal.ca/paulsutton/bash-scripting-19-checking-user-is-root</link>
      <description>&lt;![CDATA[Bash scripting 19 – checking user is root&#xA;&#xA;If we want to run a script that requires root privileges, then we can check if a user is logged in as root.   There is a detailed guide by TechAdmin&#xA;&#xA;I am not going to reproduce here, as there are some useful pointers within that article.  &#xA;&#xA;Tags&#xA;&#xA;#Bash,#BashScripting,#Bashscripting,#User,#Root,#NonRoot&#xA;&#xA;hr&#xD;&#xA;&#xD;&#xA;table&#xD;&#xA;thead&#xD;&#xA;trtda rel=&#34;me&#34; href=&#34;https://qoto.org/@zleap&#34;Mastodon/a/td&#xD;&#xA;tda href=&#34;https://wiki.ircnow.org/?n=Shelllabs.Intro&#34;ShellLabs/td&#xD;&#xA;tda href=&#34;https://joinmastodon.org/&#34;Join Mastodon/a/td/tr/thead/table&#xD;&#xA;center&#xD;&#xA;AI statement : b Consent is NOT granted to use the content of this blog for the purposes of AI training or similar activity.  Consent CANNOT be assumed, it has to be granted. /b&#xD;&#xA;/center&#xD;&#xA;&#xD;&#xA;a href=&#34;https://liberapay.com/PaulSutton/donate&#34;img alt=&#34;Donate using Liberapay&#34; src=&#34;https://liberapay.com/assets/widgets/donate.svg&#34;/a&#xD;&#xA;]]&gt;</description>
      <content:encoded><![CDATA[<p>Bash scripting 19 – checking user is root</p>

<p>If we want to run a script that requires root privileges, then we can check if a user is logged in as root.   There is a detailed guide by <a href="https://tecadmin.net/check-if-a-script-is-running-as-root-user-in-linux/" rel="nofollow">TechAdmin</a></p>

<p>I am not going to reproduce here, as there are some useful pointers within that article.</p>

<p><strong>Tags</strong></p>

<p><a href="/paulsutton/tag:Bash" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Bash</span></a>,<a href="/paulsutton/tag:BashScripting" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">BashScripting</span></a>,<a href="/paulsutton/tag:Bashscripting" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Bashscripting</span></a>,<a href="/paulsutton/tag:User" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">User</span></a>,<a href="/paulsutton/tag:Root" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Root</span></a>,<a href="/paulsutton/tag:NonRoot" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">NonRoot</span></a></p>

<hr>

<p><table>
<thead>
<tr><td><a href="https://qoto.org/@zleap" rel="nofollow">Mastodon</a></td>
<td><a href="https://wiki.ircnow.org/?n=Shelllabs.Intro" rel="nofollow">ShellLabs</td>
<td><a href="https://joinmastodon.org/" rel="nofollow">Join Mastodon</a></td></tr></thead></table>

AI statement : <b> Consent is NOT granted to use the content of this blog for the purposes of AI training or similar activity.  Consent CANNOT be assumed, it has to be granted. </b>
</p>

<p><a href="https://liberapay.com/PaulSutton/donate" rel="nofollow"><img alt="Donate using Liberapay" src="https://liberapay.com/assets/widgets/donate.svg"></a></p>
]]></content:encoded>
      <guid>https://personaljournal.ca/paulsutton/bash-scripting-19-checking-user-is-root</guid>
      <pubDate>Tue, 22 Apr 2025 06:00:00 +0000</pubDate>
    </item>
  </channel>
</rss>