<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=AppAraat</id>
	<title>Alpine Linux - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=AppAraat"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/wiki/Special:Contributions/AppAraat"/>
	<updated>2026-04-30T20:14:36Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Raspberry_Pi_Zero_W_-_Installation&amp;diff=19759</id>
		<title>Raspberry Pi Zero W - Installation</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Raspberry_Pi_Zero_W_-_Installation&amp;diff=19759"/>
		<updated>2021-07-02T23:17:09Z</updated>

		<summary type="html">&lt;p&gt;AppAraat: Removed sysfsutils as it&amp;#039;s no longer a dependency for rng-tools: https://github.com/nhorman/rng-tools/releases/tag/v6.12 (thx minimal!)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC right}}&lt;br /&gt;
= Introduction =&lt;br /&gt;
This wiki describes how I installed Alpine Linux 3.9.2 armhf on a Raspberry Pi Zero W.  I had problems with it initially as WiFi wouldn&#039;t connect when going through the setup-alpine script and when I was able to get it connect (after numerous failed manual attempts) it wouldn&#039;t reconnect on reboot.  The solution documented below adds and starts the rngd service prior to running setup-alpine which fixes the wifi connection problems and allows you to walk through the setup script successfully.  It also adds the rngd and wpa_supplicant services to start at boot and removes the network service out of the rc-update list completely, which seems like the wrong thing to do and probably is - networking still gets started, probably as a dependency to something else, and it starts after rngd and wpa_supplicant, which is what I needed.  When the networking service was set to &amp;quot;boot&amp;quot; (which it was out of the box) it was starting before rngd and wpa_supplicant so wlan0 would never connect.&lt;br /&gt;
&lt;br /&gt;
I need to go back through this again but it should work as written.  Some steps may not be necessary for your use case and some steps may not be necessary at all but don&#039;t seem to hurt.  I&#039;m still learning about Alpine Linux and hope to improve this process as I do more reading and experimentation.&lt;br /&gt;
&lt;br /&gt;
Update - 7 Dec 2019 - I went through installation again on a Pi Zero W with Alpine 3.10.3 for armhf.  First boot after writing the image to the SD card seems to work ok as far as WiFi functionality is concerned. Setup script completes and I was able to connect to WiFi and pull down packages etc. I decided to not install the rngd related packages at this point to see how a reboot looked, answer is not good. The dhcp request just times out.  Running setup-alpine again at this point also doesn&#039;t work. If you start over and rewrite the image to the SD card, the first boot will again work ok, it&#039;s only rebooting that breaks Wifi. I think it&#039;s best then to be sure to follow the steps for installing the rngd related packages and configuring the service to start at boot. Note that you can install what you need on first boot using apk, you don&#039;t need to copy the packages to the SD card offline as written below.&lt;br /&gt;
&lt;br /&gt;
Update - 29 Dec 2019 - See also a method to perform a headless setup: [[Raspberry Pi - Headless Installation]]&lt;br /&gt;
&lt;br /&gt;
= Write image to SD =&lt;br /&gt;
Format an SD card with fat filesystem first. This can be done with a graphical tool like GParted once the SD card is mounted on your operating system. The following assumes the SD card device is at /dev/sdb1.&lt;br /&gt;
&lt;br /&gt;
First, mount the SD card:&lt;br /&gt;
{{Cmd|sudo mount /dev/sdb1 /mnt}}&lt;br /&gt;
&lt;br /&gt;
Then, copy the files:&lt;br /&gt;
{{Cmd|tar -xzvf alpine-rpi-3.9.2-armhf.tar.gz -C /mnt --no-same-owner}}&lt;br /&gt;
If you have no means to mount the SD card normally with an SD reader, it can be mounted via USB via the Raspberry Pi Zero W, using the usbbootgui tool to mount as eMMC/SD card reader. On Ubuntu, this can be installed as follows:&lt;br /&gt;
{{Cmd|sudo add-apt-repository ppa:rpi-distro/ppa}}&lt;br /&gt;
{{Cmd|sudo apt install usbbootgui}}&lt;br /&gt;
&lt;br /&gt;
A GUI should open as soon as you plug in your Pi; otherwise run&lt;br /&gt;
{{Cmd|usbbootgui}}&lt;br /&gt;
&lt;br /&gt;
= Edit cmdline.txt and add line for serial console (Optional)=&lt;br /&gt;
&lt;br /&gt;
This is for my use case and optional if you are using a local keyboard and monitor.  I do not connect a keyboard and monitor but rather do the setup via the Pi&#039;s serial GPIO pins.&lt;br /&gt;
&lt;br /&gt;
Create a file called cmdline.txt in the root of the SD card and place the following text:&lt;br /&gt;
{{Cmd|modules{{=}}loop,squashfs,sd-mod,usb-storage quiet dwc_otg.lpm_enable{{=}}0 console{{=}}tty1 console{{=}}ttyAMA0,115200}}&lt;br /&gt;
&lt;br /&gt;
= Create usercfg.txt and edit (Optional) =&lt;br /&gt;
&lt;br /&gt;
This is mostly optional I believe and applies to my use case where I will be running the Pi in a headless appliance type mode.  I reduce the memory allocated for the GPU, turn off audio (not sure I still need this on the Zero W), disable bluetooth (which I think puts the serial console back on the real uart, again, need to double check), add w1 for a temperature sensor, and set the enable_uart to 1 (may not be necessary, need to verify and add comments). This can be done by creating a file called usercfg.txt at the base of the SD card with the following contents:&lt;br /&gt;
{{Cmd|gpu_mem{{=}}16&lt;br /&gt;
dtparam{{=}}audio{{=}}off&lt;br /&gt;
dtoverlay{{=}}pi3-disable-bt&lt;br /&gt;
dtoverlay{{=}}w1-gpio&lt;br /&gt;
enable_uart{{=}}1}}&lt;br /&gt;
&lt;br /&gt;
= Create cache folder and add rng-tools packages =&lt;br /&gt;
{{Cmd|mkdir /mnt/cache}}&lt;br /&gt;
I copy pasted the following into the cache dir on sd card.  I have another Alpine env to apk fetch packages from (chroot on Fedora)&lt;br /&gt;
{{Cmd|rng-tools-6.3.1-r1.652a1399.apk&lt;br /&gt;
rng-tools-openrc-6.3.1-r1.e9b063f8.apk}}&lt;br /&gt;
&lt;br /&gt;
= Boot Pi with prepared SD card, login as root and add packages =&lt;br /&gt;
&lt;br /&gt;
I&#039;m still new to Alpine, not sure if the setup-apkcache step is necessary or accomplishes anything here.&lt;br /&gt;
{{Cmd|localhost:~# setup-apkcache &lt;br /&gt;
Enter apk cache directory (or &#039;?&#039; or &#039;none&#039;) [/var/cache/apk]: /media/mmcblk0p1/cache/&lt;br /&gt;
&lt;br /&gt;
localhost:~# apk add --allow-untrusted /media/mmcblk0p1/cache/rng-tools-6.3.1-r1.652a1399.apk &lt;br /&gt;
(1/1) Installing rng-tools (6.3.1-r1)&lt;br /&gt;
Executing busybox-1.29.3-r10.trigger&lt;br /&gt;
OK: 8 MiB in 21 packages&lt;br /&gt;
&lt;br /&gt;
localhost:~# apk add --allow-untrusted /media/mmcblk0p1/cache/rng-tools-openrc-6.3.1-r1.e9b063f8.apk &lt;br /&gt;
(1/1) Installing rng-tools-openrc (6.3.1-r1)&lt;br /&gt;
OK: 8 MiB in 22 packages}}&lt;br /&gt;
&lt;br /&gt;
= Start rngd service =&lt;br /&gt;
{{Cmd|localhost:~# service rngd start&lt;br /&gt;
 * Caching service dependencies ...&lt;br /&gt;
 [ ok ]&lt;br /&gt;
 * Starting rngd ...&lt;br /&gt;
&lt;br /&gt;
Initalizing available sources&lt;br /&gt;
 [ ok ]}}&lt;br /&gt;
&lt;br /&gt;
= Run setup-alpine wifi connection should setup ok with rngd running. =&lt;br /&gt;
The setup process turns off the rngd service at some point but it&#039;s after wifi is connected&lt;br /&gt;
{{Cmd|setup-alpine}}&lt;br /&gt;
= Configure services and reboot =&lt;br /&gt;
Removing networking from boot results in it not being present in any stage which seems like the wrong fix but it still gets run by something and after rngd and wpa_supplicant which is what we want:&lt;br /&gt;
{{Cmd|pet-protect:~# rc-update add rngd boot&lt;br /&gt;
 * service rngd added to runlevel boot&lt;br /&gt;
&lt;br /&gt;
pet-protect:~# rc-update add wpa_supplicant boot&lt;br /&gt;
 * service wpa_supplicant added to runlevel boot&lt;br /&gt;
&lt;br /&gt;
pet-protect:~# rc-update del networking boot&lt;br /&gt;
 * service networking removed from runlevel boot&lt;br /&gt;
&lt;br /&gt;
pet-protect:~# rc-update -u&lt;br /&gt;
 * Caching service dependencies ...&lt;br /&gt;
 [ ok ]&lt;br /&gt;
&lt;br /&gt;
pet-protect:~# lbu commit -d&lt;br /&gt;
pet-protect:~# reboot}}&lt;br /&gt;
&lt;br /&gt;
[[category:Installation]]&lt;br /&gt;
[[category: Raspberry]]&lt;/div&gt;</summary>
		<author><name>AppAraat</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Setting_up_a_new_user&amp;diff=19718</id>
		<title>Setting up a new user</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Setting_up_a_new_user&amp;diff=19718"/>
		<updated>2021-06-28T21:42:00Z</updated>

		<summary type="html">&lt;p&gt;AppAraat: Added external link to doasedit (script), as it is not included by default: https://github.com/Duncaen/OpenDoas/issues/70&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
The &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; account should be used only for local administrative purposes that require elevated access permissions.&lt;br /&gt;
&lt;br /&gt;
This page shows how to create non-privileged user accounts. i.e. those used for daily work, including desktop usage and remote logins.&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
Creating user accounts provides users their own $HOME directory and allows you (the root user) to limit the access those user accounts have to the operating system configuration files.&lt;br /&gt;
&lt;br /&gt;
Using them increases security, because they limit possible actions and thus possible damage (even from accidental errors).&lt;br /&gt;
&lt;br /&gt;
= Creating a new user =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Warning|If using a &#039;&#039;&#039;&amp;quot;diskless&amp;quot; or &amp;quot;data&amp;quot; disk mode&#039;&#039;&#039; installation, it&#039;s important to make the &amp;lt;code&amp;gt;/home&amp;lt;/code&amp;gt; directory persistent.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* Either the &amp;lt;code&amp;gt;/home&amp;lt;/code&amp;gt; filesystem needs to be mounted from a writable partition, or&lt;br /&gt;
* the /home directories have to be added to the lbu backup, and a new local backup needs to be committed after creating the user:&lt;br /&gt;
{{Cmd| # lbu include /home&lt;br /&gt;
 # lbu commit&lt;br /&gt;
}} (Not recommended, as reverting to an older .apkovl will also revert the files in /home).&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Regular user accounts can be created with:&lt;br /&gt;
{{Cmd|# adduser [-g &amp;quot;&amp;lt;Full Name&amp;gt;&amp;quot;] &amp;lt;username&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
By default, adduser will:&lt;br /&gt;
* prompt you to set a password for the new user&lt;br /&gt;
* create a home directory in {{Path|/home/&amp;lt;username&amp;gt;}}&lt;br /&gt;
* set the shell to the one used by the &amp;lt;code&amp;gt;root&amp;lt;/code&amp;gt; account (ash by default)&lt;br /&gt;
* assign user ID and group ID starting at 1000&lt;br /&gt;
* set the GECOS (full name) field to &amp;quot;Linux User,,,&amp;quot;&lt;br /&gt;
&lt;br /&gt;
{{Tip|The optional &amp;lt;code&amp;gt;-g &amp;quot;&amp;lt;Full Name&amp;gt;&amp;quot;&amp;lt;/code&amp;gt; above sets the GECOS field.&lt;br /&gt;
This can be very useful to specify. Setting this string - at least equal to the username - makes the user distinguishable, e.g. when they are listed at the login screen of a display manager.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Users who must be able to access an Xorg instance must be added to the &amp;lt;code&amp;gt;video&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;input&amp;lt;/code&amp;gt; groups:&lt;br /&gt;
 adduser &#039;UserName&#039; video&lt;br /&gt;
 adduser &#039;UserName&#039; input&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;If a user &#039;&#039;really must&#039;&#039; be allowed to have access to the root account&#039;&#039;&#039;, the &amp;lt;username&amp;gt; can be added to the wheel group, &amp;lt;code&amp;gt;doas&amp;lt;/code&amp;gt; (&amp;quot;do as&amp;quot;) may be installed, and the group &amp;quot;wheel&amp;quot; can be allowed to become root:&lt;br /&gt;
 adduser -g &amp;quot;&amp;lt;username&amp;gt;&amp;quot; &amp;lt;username&amp;gt;&lt;br /&gt;
 adduser &amp;lt;username&amp;gt; wheel&lt;br /&gt;
 apk add doas&lt;br /&gt;
 apk add nano&lt;br /&gt;
 nano /etc/doas.conf&lt;br /&gt;
&lt;br /&gt;
{{Warning|It&#039;s recommended to &#039;&#039;&#039;not&#039;&#039;&#039; run complete applications, like editors, as root just to modify administrative files.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
* Many desktop environments and file browsers support using &amp;lt;code&amp;gt;admin:///&amp;lt;/code&amp;gt; in their address bars, to access files through a local gvfs-admin mount&lt;br /&gt;
* [https://github.com/AN3223/scripts/blob/master/doasedit &amp;lt;code&amp;gt;doasedit&amp;lt;/code&amp;gt;] or &amp;lt;code&amp;gt;sudoedit&amp;lt;/code&amp;gt; enables starting an editor with a temporary copy of a file, which overwrites the original file after the user modifies and saves it. For example, &amp;lt;code&amp;gt;sudoedit /etc/apk/lbu.conf&amp;lt;/code&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
The &amp;lt;code&amp;gt;sudo&amp;lt;/code&amp;gt; package is an alternative to using the BSD-like &amp;lt;code&amp;gt;doas&amp;lt;/code&amp;gt;, but is a much larger package.&lt;br /&gt;
It may be used as follows: adding a custom user configuration file to avoid having to deal with manually changing configuration files later during package upgrades.&lt;br /&gt;
 apk add sudo&lt;br /&gt;
 NEWUSER=&#039;yourUserName&#039;&lt;br /&gt;
 adduser -d &amp;quot;${NEWUSER}&amp;quot; $NEWUSER&lt;br /&gt;
 echo &amp;quot;$NEWUSER ALL=(ALL) ALL&amp;quot; &amp;gt; /etc/sudoers.d/$NEWUSER &amp;amp;&amp;amp; chmod 0440 /etc/sudoers.d/$NEWUSER&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The new user gets listed in &lt;br /&gt;
&lt;br /&gt;
{{Cat|/etc/passwd|root:x:0:0:root:/root:/bin/ash&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&amp;lt;username&amp;gt;:x:1000:1000:Linux User,,,:/home/&amp;lt;username&amp;gt;:/bin/ash}}&lt;br /&gt;
&lt;br /&gt;
Now you should be able to issue the command &amp;lt;code&amp;gt;exit&amp;lt;/code&amp;gt; and login to the new account.&lt;br /&gt;
&lt;br /&gt;
= Options =&lt;br /&gt;
&lt;br /&gt;
=== adduser ===&lt;br /&gt;
&lt;br /&gt;
Usage (from &amp;quot;man busybox&amp;quot;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;adduser [OPTIONS] USER [GROUP]&lt;br /&gt;
&lt;br /&gt;
Create new user, or add USER to GROUP&lt;br /&gt;
&lt;br /&gt;
     -h --home DIR           Home directory&lt;br /&gt;
     -g --gecos GECOS        GECOS field&lt;br /&gt;
     -s --shell SHELL        Login shell named SHELL by example /bin/bash&lt;br /&gt;
     -G --ingroup GRP        Group (by name)&lt;br /&gt;
     -S --system             Create a system user&lt;br /&gt;
     -D --disabled-password  Don&#039;t assign a password, so cannot login&lt;br /&gt;
     -H --no-create-home     Don&#039;t create home directory&lt;br /&gt;
     -u --uid UID            User id&lt;br /&gt;
     -k SKEL                 Skeleton directory (/etc/skel)&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Tip|Multi-user collaboration&lt;br /&gt;
If &amp;lt;nowiki&amp;gt;--ingroup&amp;lt;/nowiki&amp;gt; isn&#039;t set, (default) the new user is assigned a new GID that matches the UID. If the GID corresponding to a provided UID already exists, adduser will fail.&lt;br /&gt;
&lt;br /&gt;
This ensures new users default to having a &amp;quot;user&#039;s private group&amp;quot; (UPG) as primary group. These allow the system to use a permission umask (002), which creates new files automatically as group-writable, but only by the user&#039;s private group. In special set-group-id (collaboration) directories, new files can be automatically created writable by the directory&#039;s group.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== addgroup ===&lt;br /&gt;
&lt;br /&gt;
Usage (from &amp;quot;man busybox&amp;quot;): &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;addgroup [-g GID] [-S] [USER] GROUP&lt;br /&gt;
&lt;br /&gt;
Create a group or add a user to a group&lt;br /&gt;
&lt;br /&gt;
    -g --gid GID    Group id&lt;br /&gt;
    -s --system     Create a system group&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Legacy =&lt;br /&gt;
&lt;br /&gt;
=== Common permission groups ===&lt;br /&gt;
&lt;br /&gt;
(Taken from https://git.alpinelinux.org/alpine-baselayout/tree/group)&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;disk&#039;&#039;&#039;:x:6:root,adm  needed only for use vith virtual machines and access to other partitions.&lt;br /&gt;
* &#039;&#039;&#039;lp&#039;&#039;&#039;:x:7:lp  needed for printing services and printers management.&lt;br /&gt;
* &#039;&#039;&#039;wheel&#039;&#039;&#039;:x:10:root  Administrator group, members can use &amp;lt;code&amp;gt;sudo&amp;lt;/code&amp;gt; to run commands as root if enabled in the sudo configuration.&lt;br /&gt;
* &#039;&#039;&#039;floppy&#039;&#039;&#039;:x:11:root  Backward compatible group. Use only if access to special external devices is needed.&lt;br /&gt;
* &#039;&#039;&#039;audio&#039;&#039;&#039;:x:18:  Needed for audio listening and management of sound volume as normal user.&lt;br /&gt;
* &#039;&#039;&#039;cdrom&#039;&#039;&#039;:x:19:  For access to CD/DVD/BR writers and mounting DVD, BR or CD rom disk as normal user.&lt;br /&gt;
* &#039;&#039;&#039;dialout&#039;&#039;&#039;:x:20:root  Needed for dialing private connections and use of modems as normal user.&lt;br /&gt;
* &#039;&#039;&#039;tape&#039;&#039;&#039;:x:26:root  Needed if you&#039;re planning to use special devices for backup. Rare. Ususally used only on servers.&lt;br /&gt;
* &#039;&#039;&#039;video&#039;&#039;&#039;:x:27:root  For usage of cameras, more than one GPU special features, as normal user.&lt;br /&gt;
* &#039;&#039;&#039;netdev&#039;&#039;&#039;:x:28:  For network connections management as normal user.&lt;br /&gt;
* &#039;&#039;&#039;kvm&#039;&#039;&#039;:x:34:kvm Only if a normal user will manage virtual machines via a GUI. Rare. Ususally used only on servers.&lt;br /&gt;
* &#039;&#039;&#039;games&#039;&#039;&#039;:x:35:  Needed if you want to play games. Especially if sharing scores between users.&lt;br /&gt;
* &#039;&#039;&#039;cdrw&#039;&#039;&#039;:x:80:  Needed to write RW-DVD, RW-BR or RW-CD disk on a disk writing device.&lt;br /&gt;
* &#039;&#039;&#039;apache&#039;&#039;&#039;:x:81: Needed if you do development as normal user and want to publish locally on web server.&lt;br /&gt;
* &#039;&#039;&#039;usb&#039;&#039;&#039;:x:85: Needed to access to special usb devices. Deprecated group.&lt;br /&gt;
* &#039;&#039;&#039;users&#039;&#039;&#039;:x:100:games Needed if you plan to use common files for all users. Mandatory for desktop usage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Old newbie notes =&lt;br /&gt;
&lt;br /&gt;
=== User creation and defaults ===&lt;br /&gt;
&lt;br /&gt;
The following commands will set up root environment login, then assign a new password:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
cat &amp;gt; /root/.cshrc &amp;lt;&amp;lt; EOF&lt;br /&gt;
unsetenv DISPLAY || true&lt;br /&gt;
HISTCONTROL=ignoreboth&lt;br /&gt;
EOF&lt;br /&gt;
&lt;br /&gt;
cp /root/.cshrc /root/.profile&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;secret_new_root_password&amp;quot; | chpasswd&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By default, remote management cannot be done direct;y with the root account. Because of SSH security we need to set up a remote connection account that will be used to switch to the root user via the su command, once connected. &lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example: create user named &amp;quot;remote&amp;quot; and a user named &amp;quot;general.&amp;quot; We will set up a hardened, limited, user environment and create those two users:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
mkdir -p /etc/skel/&lt;br /&gt;
&lt;br /&gt;
cat &amp;gt; /etc/skel/.logout &amp;lt;&amp;lt; EOF&lt;br /&gt;
history -c&lt;br /&gt;
/bin/rm -f /opt/remote/.mysql_history&lt;br /&gt;
/bin/rm -f /opt/remote/.history&lt;br /&gt;
/bin/rm -f /opt/remote/.bash_history&lt;br /&gt;
EOF&lt;br /&gt;
&lt;br /&gt;
cat &amp;gt; /etc/skel/.cshrc &amp;lt;&amp;lt; EOF&lt;br /&gt;
set autologout = 30&lt;br /&gt;
set prompt = &amp;quot;$ &amp;quot;&lt;br /&gt;
set history = 0&lt;br /&gt;
set ignoreeof&lt;br /&gt;
EOF&lt;br /&gt;
&lt;br /&gt;
cp /etc/skel/.cshrc /etc/skel/.profile&lt;br /&gt;
&lt;br /&gt;
adduser -D --home /opt/remote --shell /bin/ash remote&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;secret_new_remote_user_password&amp;quot; | chpasswd&lt;br /&gt;
&lt;br /&gt;
adduser -D --shell /bin/bash general&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;secret_new_general_user_password&amp;quot; | chpasswd&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Tip|&amp;quot;&#039;&#039;&#039;general&#039;&#039;&#039;&amp;quot; is the name of the user. That name MUST contain ONLY lowercase letters, NO spaces and NO symbols}}&lt;br /&gt;
&lt;br /&gt;
Note that those users are created with minimal privilege settings.&lt;br /&gt;
&lt;br /&gt;
== User management and system access ==&lt;br /&gt;
&lt;br /&gt;
By default, a newly created user will not have enough privileges for most desktop purposes.&lt;br /&gt;
&lt;br /&gt;
To add newly created users to groups that may come in handy for desktop useage, you run this command as root:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
for u in $(ls /home); do for g in disk lp floppy audio cdrom dialout video netdev games users; do addgroup $u $g; done;done&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>AppAraat</name></author>
	</entry>
</feed>