SETUP-USER(8)
π 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 thewheelgroup, anddoasgets configured withpermit persist :wheelin/etc/doas.d/20-wheel.conf. admin main character energy fr fr.-fFULLNAME β sets the full name for the new user. cute, personal, iconic.-gGROUPS β 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 π«Ά-kSSHKEY β SSH authorized key for the user π this accepts a raw key string, an HTTP/HTTPS URL, ornone. and the valuenoneskips key setup entirely β no key, no problem.-uβ unlock the user withpasswd -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:
alβ expand tohttps://gitlab.alpinelinux.org/USER_.keys_π§glβ expand tohttps://gitlab.com/USER_.keys_πΈghβ expand tohttps://github.com/USER_.keys_β
π FILES π
/home/USER_/.ssh/authorized_keys_β installed when an SSH key is provided π/etc/doas.d/20-wheel.confβ created by the-aoption withpermit 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
- alpine 3.24: alpine-conf-doc 3.22.0-r0 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms