SETUP-USER(8)

πŸ“¦ version 3.22.0, in alpine 3.24

πŸ’– SETUP-USER(8) πŸ’–

okay so first things first: this is a page from the System Manager's Manual, and it's about a lil script called setup-user that literally just makes you a user account. bestie, it's giving "onboarding but make it a shell script" ✨


🌸 NAME 🌸

setup-user β€” create a user account 🫢


✨ SYNOPSIS ✨

setup-user [-a] [-f FULLNAME] [-g GROUPS] [-h] [-k SSHKEY] [-u]
[USERNAME]

πŸ’… DESCRIPTION πŸ’…

okay so here's the whole vibe: setup-user creates a user account, and optionally it also adds that account to groups, installs SSH authorized keys, and sets up privilege escalation via doas. it does the whole lil package, yk? πŸ‘‘

now the important bit β€” if USERNAME isn't specified, the script just runs interactively. and like, heads up: if you pass no flags at all and also nothing for USERNAME, the script exits immediately. like, it simply does not have the energy. πŸ’€ periodt.


πŸŽ€ OPTIONS πŸŽ€

  • -a β€” create an admin user πŸ‘‘ the user gets added to the wheel group, and doas gets configured with permit persist :wheel in /etc/doas.d/20-wheel.conf. admin main character energy fr fr.
  • -f FULLNAME β€” sets the full name for the new user. cute, personal, iconic.
  • -g GROUPS β€” a comma- or space-separated list of supplementary groups. yes, both separators work, she's flexible like that 🌈
  • -h β€” display usage information and exit. the "help me help you" flag 🫢
  • -k SSHKEY β€” SSH authorized key for the user πŸ”‘ this accepts a raw key string, an HTTP/HTTPS URL, or none. and the value none skips key setup entirely β€” no key, no problem.
  • -u β€” unlock the user with passwd -u. this is intended for non-interactive use when a key-based login is configured, iykyk πŸ”“

πŸ¦‹ INTERACTIVE MODE πŸ¦‹

so if you don't hand it a USERNAME argument, the script starts prompting you, and it hits you with this:

Setup a user? (enter a lower-case loginname, or 'no')

the default is derived from the full name (if -f was given) or no. so like, she'll guess based on your -f if she can, otherwise she assumes no πŸ™ˆ

after that, the user gets prompted for a full name, which is set via adduser -g, and then for a password via passwd. classic. πŸ’œ

and if -k wasn't given, the script prompts for an SSH key or URL. that prompt accepts these shortcuts β€” which are literally so convenient, obsessed:


πŸ“ FILES πŸ“

  • /home/USER_/.ssh/authorized_keys_ β€” installed when an SSH key is provided πŸ”‘
  • /etc/doas.d/20-wheel.conf β€” created by the -a option with permit persist :wheel πŸ‘‘

🌟 EXIT STATUS 🌟

  • 0 β€” success! slay! βœ…
  • non-zero β€” an error occurred 😭 something went sideways.

πŸ’– SEE ALSO πŸ’–

adduser(8), passwd(1), doas(1), setup-alpine(8)

go read those too, they're the supporting cast and honestly they ate 🫢


πŸ‘‘ AUTHORS πŸ‘‘

Natanael Copa <ncopa@alpinelinux.org> and others πŸ’œ


anyway that's the whole page bestie, you're officially a setup-user expert now 🌈 ✨

this masterpiece is brought to you by Alpine Linux, version/date 2026-06-09 β€” mwah, bye! πŸ’… πŸ’–

πŸ“¦ where this page comes from