This episode covers user and group management in Alpine with adduser, addgroup, and deluser, including the contents of /etc/passwd and /etc/group. You'll also learn doas as a sudo replacement, the /etc/doas.d configuration, and the role of the wheel group for administrative privileges.

Every multi-user system needs identity management, and Alpine provides it in a simple way. Episode 6 covers users and groups with adduser, addgroup, and deluser, then moves into the topic that most often surprises newcomers: doas as a sudo replacement.
When the setup-alpine wizard created the admin user in episode 3, it automatically set up the access-rights configuration. This episode explains what actually happened behind the scenes and how to manage it yourself.
Alpine uses BusyBox's adduser (not Debian's adduser). The basic syntax:
adduser arman
adduser -s /bin/bash -h /home/arman arman
adduser -G wheel arman
deluser arman
deluser arman --remove-homeExplanation:
adduser arman creates an interactive user with a home in /home.-s sets the shell, -h sets the home directory.-G wheel adds the user to the wheel group.deluser --remove-home removes the user along with their home.Users created via setup-alpine in episode 3 are automatically placed in the wheel group, so they can get administrative privileges.
Groups are managed in a similar way:
addgroup developers
addgroup arman developers
delgroup developersadduser arman developers adds an existing user to a new group. To view membership, read the /etc/group file.
The /etc/passwd file stores user accounts, one line per user:
root:x:0:0:root:/root:/bin/ash
arman:x:1000:1000:arman:/home/arman:/bin/ashThe columns are username, password (x means it's stored in /etc/shadow), UID, GID, description, home, and shell. Note that Alpine's default shell is /bin/ash — the BusyBox shell.
The /etc/group file stores groups:
wheel:x:10:root,arman
developers:x:1001:armanThe columns are group name, password, GID, and member list. When troubleshooting file permissions, check the UID in /etc/passwd and the GID in /etc/group:
cat /etc/passwd
cat /etc/group
id armanThe id arman output shows the UID, GID, and all the groups the user belongs to.
Alpine uses doas as its default privilege elevation tool — not sudo. doas comes from OpenBSD: it's much smaller, uses a single configuration file, and has a smaller attack surface. Users created by setup-alpine automatically get a doas configuration.
The doas configuration lives at /etc/doas.d/doas.conf:
permit persist :wheelThe permit persist :wheel line lets all members of the wheel group run commands as root without being asked for the password repeatedly (thanks to persist). Use doas for admin commands:
doas apk update
doas -u arman whoamidoas -u arman whoami runs a command as another user. doas's default behavior asks for the password of the currently active user, not the root password.
Even though doas is the default, sudo is still available in the community repository:
apk add sudo
adduser -G wheel arman
vi /etc/sudoers.d/armanJust run apk add sudo if your project needs compatibility with scripts that expect sudo. But for fresh installs, doas is the choice that fits Alpine's philosophy better.
The wheel group is the door to administrative privileges. A good policy:
developers for the app team and docker for container users.Manage wheel membership carefully:
adduser -G wheel arman
deluser arman wheeldeluser arman wheel removes arman from the wheel group, which also revokes their doas privileges.
Warning
Double-check the syntax of /etc/doas.d/doas.conf after editing. A wrong configuration can lock you out of administrative privileges. Always make sure another user is in the wheel group before testing.
Episode 6 covered user and group management in Alpine: creating users with adduser, managing groups with addgroup and delgroup, reading /etc/passwd and /etc/group, configuring doas in /etc/doas.d, and leveraging the wheel group for administrative privileges.
Key takeaways:
In the next episode, episode 7, we'll cover basic networking and the filesystem — OpenRC-style /etc/network/interfaces configuration, the ifup, ifdown, and ip commands, DNS setup in /etc/resolv.conf, and the filesystem layout, /etc/fstab, and support for ext4, btrfs, and xfs.