<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>adding &amp;mdash; Paul Sutton</title>
    <link>https://personaljournal.ca/paulsutton/tag:adding</link>
    <description>Personal Blog</description>
    <pubDate>Tue, 05 May 2026 16:27:28 +0000</pubDate>
    <item>
      <title>Bash scripting 23 - users</title>
      <link>https://personaljournal.ca/paulsutton/bash-scripting-23-users</link>
      <description>&lt;![CDATA[Bash scripting 23 - users&#xA;&#xA;To add new users to a system, we can use the command.  You will need to have root privileges for this, so you need to prefix with sudo, e.g.  &#xA;&#xA;Permissions, the initial user you create when setting up the pi, has sudo or admin privileges.  Additional users will not. Unless you take steps to give that user those permissions.&#xA;&#xA;sudo useradd user&#xA;&#xA;The rest of the process is interactive,  in this example I am adding the user gopher to the raspberry Pi4 system we are also using for testing cron.&#xA;&#xA;sudo adduser gopher&#xA;Adding user `gopher&#39; ...&#xA;Adding new group `gopher&#39; (1001) ...&#xA;Adding new user gopher&#39; (1001) with group gopher (1001)&#39; ...&#xA;Creating home directory `/home/gopher&#39; ...&#xA;Copying files from `/etc/skel&#39; ...&#xA;New password: &#xA;Retype new password: &#xA;passwd: password updated successfully&#xA;Changing the user information for gopher&#xA;Enter the new value, or press ENTER for the default&#xA;&#x9;Full Name []: Gopher&#xA;&#x9;Room Number []: 0&#xA;&#x9;Work Phone []: 0&#xA;&#x9;Home Phone []: 0&#xA;&#x9;Other []: 0&#xA;Is the information correct? [Y/n] y&#xA;Adding new user gopher&#39; to supplemental / extra groups users&#39; ...&#xA;Adding user gopher&#39; to group users&#39; ...&#xA;&#xA;I can now login to the user gopher on the Raspberry Pi with&#xA;&#xA;$ ssh gopher@192.168.1.202&#xA;gopher@192.168.1.202&#39;s password: &#xA;Linux raspberrypi 6.12.20+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.12.20-1+rpt1~bpo12+1 (2025-03-19) aarch64&#xA;&#xA;The programs included with the Debian GNU/Linux system are free software;&#xA;the exact distribution terms for each program are described in the&#xA;individual files in /usr/share/doc/*/copyright.&#xA;&#xA;Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent&#xA;permitted by applicable law.&#xA;gopher@raspberrypi:~ $ &#xA;&#xA;To change the password on a GNU/Linux system, use &#xA;passwd&#xA;&#xA;To delete a user, use the userdel command, I am not going into this here, so as with other commands, there is a man page &#xA;&#xA;man userdel&#xA;userdel - delete a user account and related files&#xA;&#xA;Tags&#xA;&#xA;#Bash,#Bashscripting,#BashScripting#users,#adding&#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 23 – users</p>

<p>To add new users to a system, we can use the command.  You will need to have root privileges for this, so you need to prefix with sudo, e.g.</p>

<p>**Permissions, the initial user you create when setting up the pi, has sudo or admin privileges.  Additional users will <strong>not</strong>. Unless you take steps to give that user those permissions.**</p>

<pre><code>sudo useradd &lt;user&gt;
</code></pre>

<p>The rest of the process is interactive,  in this example I am adding the user gopher to the raspberry Pi4 system we are also using for testing cron.</p>

<pre><code>sudo adduser gopher
Adding user `gopher&#39; ...
Adding new group `gopher&#39; (1001) ...
Adding new user `gopher&#39; (1001) with group `gopher (1001)&#39; ...
Creating home directory `/home/gopher&#39; ...
Copying files from `/etc/skel&#39; ...
New password: 
Retype new password: 
passwd: password updated successfully
Changing the user information for gopher
Enter the new value, or press ENTER for the default
	Full Name []: Gopher
	Room Number []: 0
	Work Phone []: 0
	Home Phone []: 0
	Other []: 0
Is the information correct? [Y/n] y
Adding new user `gopher&#39; to supplemental / extra groups `users&#39; ...
Adding user `gopher&#39; to group `users&#39; ...
</code></pre>

<p>I can now login to the user gopher on the Raspberry Pi with</p>

<pre><code>$ ssh gopher@192.168.1.202
gopher@192.168.1.202&#39;s password: 
Linux raspberrypi 6.12.20+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.12.20-1+rpt1~bpo12+1 (2025-03-19) aarch64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
gopher@raspberrypi:~ $ 

</code></pre>

<p>To change the password on a GNU/Linux system, use</p>

<pre><code>passwd
</code></pre>

<p>To delete a user, use the userdel command, I am not going into this here, so as with other commands, there is a man page</p>

<pre><code>man userdel
userdel - delete a user account and related files
</code></pre>

<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:users" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">users</span></a>,<a href="/paulsutton/tag:adding" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">adding</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-23-users</guid>
      <pubDate>Mon, 28 Apr 2025 06:30:00 +0000</pubDate>
    </item>
  </channel>
</rss>