roleadd(8) on Solnix vs Linux and the BSDs
roleadd is the illumos command at /usr/sbin/roleadd. It adds a role account, with authorizations and profiles recorded in /etc/user_attr. Linux useradd and FreeBSD pw add ordinary users and have no matching role options in the bundle. Some single-letter flags also mean something different on each system.
The manual pages
- Solnix: roleadd(8) from
pkgs.solnix.illumos-world-man· illumos.org - Linux: useradd(8) shadow-4.19.4 (different command, similar job)
- FreeBSD: pw(8) 15.1-RELEASE (different command, similar job)
What Solnix runs
A default Solnix system runs the illumos roleadd at /usr/sbin/roleadd. No other variants are shipped. The bundle has no OpenBSD or NetBSD counterpart page, so this page does not compare them. Comparisons are with Linux useradd(8) and FreeBSD pw(8), which have different names.
Differences
| Compared with | Topic | What differs |
|---|---|---|
| Linux, FreeBSD | roles and user_attr | roleadd writes /etc/passwd, /etc/shadow and /etc/user_attr, and -A (authorizations) and -P (profiles) set the role's rights. The useradd and pw texts in the bundle describe no role concept and no authorization or profile options.Source: Solnix roleadd(8) DESCRIPTION, -A, -P; Linux useradd(8) OPTIONS; FreeBSD pw(8) SYNOPSIS |
| Linux | -K meaning | On Solnix, -K key=value adds a pair to the role's /etc/user_attr entry, and the key "type" is not allowed. On Linux, -K overrides /etc/login.defs values such as UID_MIN, UID_MAX, UMASK and PASS_MAX_DAYS.Source: Solnix roleadd(8) -K; Linux useradd(8) -K, --key |
| Linux, FreeBSD | -p meaning | Solnix -p names a project (project(5)). The FreeBSD pw synopsis uses -p for passexpdate. The Linux option list shows -p as --password. The shown Linux text does not describe it.Source: Solnix roleadd(8) -p; FreeBSD pw(8) SYNOPSIS useradd -p passexpdate; Linux useradd(8) option list (-p, --password) |
| Linux, FreeBSD | -N meaning | Solnix roleadd has no -N. On Linux, -N means no user group. On FreeBSD, pw -N prints the result of an add or modify without updating the databases. Solnix has no dry-run option in its synopsis.Source: Solnix roleadd(8) SYNOPSIS; Linux useradd(8) option list (-N, --no-user-group) and -g text; FreeBSD pw(8) -N |
| Linux | -Z meaning | With -m, Solnix -z always tries to create a new ZFS file system for the home directory and -Z never does. Linux lists -Z as --selinux-user, which is unrelated.Source: Solnix roleadd(8) -m [-z|-Z]; Linux useradd(8) option list (-Z, --selinux-user) |
| Linux | default primary group | Without -g, a Solnix role gets the default group, which is other (GID 1) unless changed with roleadd -D -g. Linux depends on USERGROUPS_ENAB: it creates a group named after the user, or else uses GROUP from /etc/default/useradd, or 1000.Source: Solnix roleadd(8) -g, -D defaults; Linux useradd(8) -g |
| Linux, FreeBSD | where defaults live | Solnix roleadd -D sets defaults for -A, -b, -e, -f, -g, -k, -K, -p, -P and -s. Built-in defaults are /home, /etc/skel and /bin/pfsh. Linux reads /etc/default/useradd and login.defs. FreeBSD pw reads /etc/pw.conf, or the file given with -C.Source: Solnix roleadd(8) -D; Linux useradd(8) -b, -e, -k; FreeBSD pw(8) -C |
| Linux | -e expiry date format | Solnix -e takes a date in one of the formats in /etc/datemsk (see getdate(3C)); quote it if it has spaces. Linux -e takes YYYY-MM-DD or days since 1970-01-01, read as UTC. A Linux-style date may not parse on Solnix.Source: Solnix roleadd(8) -e; Linux useradd(8) -e, --expiredate |
| Linux, FreeBSD | -f inactive | Solnix -f is the maximum days between uses of the role ID, and 0 defeats the check. Linux -f counts days after the password exceeds its maximum age: 0 disables at once, -1 turns it off. The FreeBSD pw useradd synopsis has no -f.Source: Solnix roleadd(8) -f; Linux useradd(8) -f, --inactive; FreeBSD pw(8) SYNOPSIS |
| Linux | home directory creation | Solnix creates the home directory only with -m, and an existing directory must be rwx for the role's primary group. Linux can also create it via CREATE_HOME in login.defs, and has -M to prevent creation.Source: Solnix roleadd(8) -m; Linux useradd(8) -d, -m, -M |
| Linux, FreeBSD | account state after creation | The Solnix page says the new role stays locked until passwd(1) is run. The Linux and FreeBSD texts in the bundle do not say how a new account's password state is set. Source: Solnix roleadd(8) DESCRIPTION; Linux useradd(8) DESCRIPTION; FreeBSD pw(8) DESCRIPTION |
| Linux, FreeBSD | alternate root and logging | Solnix roleadd has no -R or -V option. Linux lists -R/--root, and FreeBSD pw has -R rootdir and -V etcdir. pw also logs actions to /var/log/userlog. The Solnix page documents no such log.Source: Solnix roleadd(8) SYNOPSIS; Linux useradd(8) option list (-R, --root); FreeBSD pw(8) -R, -V, NOTES |
| FreeBSD | command syntax | Solnix uses roleadd [options] role, with the name last. FreeBSD uses pw useradd name [options], and the name can also be given with -n. pw also accepts keyword orders such as "user add".Source: Solnix roleadd(8) SYNOPSIS; FreeBSD pw(8) SYNOPSIS, DESCRIPTION |
Everyday tasks
| Task | Solnix | Linux | FreeBSD |
|---|---|---|---|
| create an account | roleadd role | useradd LOGIN | pw useradd name |
| create the home directory too | roleadd -m role | useradd -m LOGIN | pw useradd name -m |
| show default values | roleadd -D | useradd -D | pw useradd -D |
| assign authorizations or profiles | roleadd -A auth -P profile role | — | — |
| preview without changing databases | — | — | pw useradd name -N |
| set expiry date | roleadd -e expire role | useradd -e EXPIRE_DATE LOGIN | pw useradd name -e accexpdate |
| unlock the new account | passwd(1) after roleadd | — | — |
Standards
- POSIX: roleadd is not a POSIX.1-2024 utility.
Writing portable scripts
- Do not share useradd or pw option strings with roleadd.
-K,-N,-p,-Zand-fmean different things, and the other systems have no-Aor-P. - Branch on which tool is installed (roleadd, useradd, pw) and use only the
-m,-d,-c,-g,-G,-sand-uoptions that all three list.
Every difference here is taken from the manual pages linked above: Solnix's published page, Linux (man-pages and the GNU and util-linux manuals), FreeBSD, OpenBSD and NetBSD. Each row names its source. Where a manual is silent, this page is too. Compiled 2026-10-26. Found a mistake? Mail hackers@lists.solnix.io.