Assuming you don’t want to use the root account the whole time, here’s how you create a user in Linux.
Setup sudo
sudo does not come by default on our arch installation. We need to install it and change it’s configuration.
pacman -S sudoEdit the sudoers file with this command,
EDITOR=vim visudothen uncomment the line that says :wheel ALL=(ALL) ALL.
…or doas
opendoas is the replacement for sudo used on openbsd. It’s more lightweight and secure than sudo. First, install it:
pacman -S doasAllow all users in wheel group to execute commands.
### /etc/doas.conf ###
permit persist :wheelCreate User
Run this command to create a user.
useradd -mG wheel -s /bin/zsh USERNAMELong-form:
useradd --create-home --gid wheel --shell /bin/zsh USERNAMESystemd-homed
An alternative to traditional user management is systemd-homed. To use it, you need to enable the service, then create your user.
systemctl enable --now systemd-homedhomectl create USERNAME --shell=/bin/zsh --uid=1000 --member-of=wheel --real-name="YOUR NAME"If you use BTRFS for your root partition, you can add
--storage=subvolume, which will make your home directory a BTRFS subvolume.
Set User Password
passwd USERNAME