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 sudo
Edit the sudoers
file with this command,
EDITOR=vim visudo
then 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 doas
Allow all users in wheel group to execute commands.
### /etc/doas.conf ###
permit persist :wheel
Create User
Run this command to create a user.
useradd -mG wheel -s /bin/zsh USERNAME
Long-form:
useradd --create-home --gid wheel --shell /bin/zsh USERNAME
Systemd-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-homed
homectl 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