useradd(8) on Solnix vs Linux and the BSDs

On Solnix, useradd is the illumos useradd at /usr/sbin/useradd. It writes /etc/passwd, /etc/shadow and /etc/user_attr, and its -p, -P, -R, -K and -Z mean different things than on Linux or NetBSD. A new login stays locked until passwd(1) is run.

What Solnix runs

A default Solnix system runs the illumos useradd at /usr/sbin/useradd. No other variants are shipped. FreeBSD has no useradd in the bundle: its counterpart is pw(8) with the useradd keyword. The bundle has no OpenBSD counterpart page.

Differences

Compared withTopicWhat differs
Linux, NetBSD-p meaningSolnix -p names a project (project(5)). Linux -p and NetBSD -p supply an already-encrypted password. A script that passes a password hash with -p will set a project name on Solnix instead.
Source: Solnix useradd(8) -p projname; NetBSD useradd(8) -p password; Linux useradd(8) --password, -p
Linux-R, -P and -Z meaningSolnix -R assigns roles and -P assigns execution profiles. Linux -R/--root and -P/--prefix select alternate directories, and Linux -Z sets an SELinux user. On Solnix, -Z means never create a ZFS file system for the home directory.
Source: Solnix useradd(8) -R, -P, -Z; Linux useradd(8) --root, --prefix, -Z, --selinux-user
Linux, FreeBSD, NetBSD-K meaningSolnix -K adds a key=value pair to the user's /etc/user_attr entry; the "type" key is rejected. Linux -K overrides /etc/login.defs values such as UID_MIN for this one call. The FreeBSD pw and NetBSD pages show no -K for useradd.
Source: Solnix useradd(8) -K; Linux useradd(8) -K, --key; FreeBSD pw(8) SYNOPSIS useradd; NetBSD useradd(8) SYNOPSIS
Linux, NetBSDnew login is lockedSolnix creates the login locked, and it stays locked until passwd(1) is run. Linux and NetBSD can set a password at creation time with -p, using a pre-encrypted string. Solnix -p cannot do this.
Source: Solnix useradd(8) DESCRIPTION; Linux useradd(8) -p; NetBSD useradd(8) -p
Linux, NetBSDdefault primary groupSolnix without -g puts the user in the default group other (GID 1), changeable with useradd -D -g. Linux creates a group named after the user by default, subject to USERGROUPS_ENAB. NetBSD takes the default from usermgmt.conf, and -g =uid makes a matching new group.
Source: Solnix useradd(8) -D, -g; Linux useradd(8) DESCRIPTION, -g; NetBSD useradd(8) -g
Linux, FreeBSD, NetBSDwhere defaults are storedSolnix keeps -D defaults in /etc/default/useradd (also used for EXCEED_TRAD and MANAGE_ZFS). Linux uses /etc/default/useradd plus /etc/login.defs. NetBSD uses /etc/usermgmt.conf. FreeBSD pw reads /etc/pw.conf, or the file given with -C.
Source: Solnix useradd(8) DESCRIPTION, -m; Linux useradd(8) -b, -e, -g; NetBSD useradd(8) DESCRIPTION; FreeBSD pw(8) -C
Linux, NetBSD-e expiry date formatSolnix -e takes a date in one of the formats in /etc/datemsk (see getdate(3C)); a null value " " disables expiry. Linux takes YYYY-MM-DD or days since 1970-01-01. NetBSD takes "month day year" or epoch seconds, and 0 disables.
Source: Solnix useradd(8) -e; Linux useradd(8) -e, --expiredate; NetBSD useradd(8) -e
Linux-f inactive meaning and disable valueSolnix -f is the maximum days between uses of a login before it becomes invalid; 0 defeats the check. Linux -f counts days after the password expires. On Linux, 0 disables the account at expiry and -1 turns the check off.
Source: Solnix useradd(8) -f; Linux useradd(8) -f, --inactive
Linux, NetBSDhome directory creation and ZFSSolnix -m creates the home directory. If its parent is on a separate ZFS file system and MANAGE_ZFS=YES is set in /etc/default/useradd, a new ZFS file system is created. -z forces one, -Z forbids one. Linux and NetBSD have no such option.
Source: Solnix useradd(8) -m [-z|-Z]; Linux useradd(8) -m, -M; NetBSD useradd(8) -m
Linuxflags missing on SolnixSolnix useradd has no -M, -N, -U, -l, -r or -F. Linux has all of these, including long forms like --no-create-home and --no-log-init. Scripts using them fail on Solnix.
Source: Solnix useradd(8) SYNOPSIS; Linux useradd(8) OPTIONS (-M, -l, -F, --no-user-group, --user-group)
NetBSDflags missing on Solnix, and -rNetBSD -r is a uid range lowuid..highuid. Solnix has no -r. Solnix also lacks NetBSD's -L, -M, -S, -v and -F, and its -F means nothing. Solnix has -A, -P, -R and -K for RBAC attributes instead.
Source: NetBSD useradd(8) SYNOPSIS, -r, -L, -M, -S, -v; Solnix useradd(8) SYNOPSIS
FreeBSDdifferent command and syntaxFreeBSD has no useradd. You run pw useradd name [options]. The name may come first and the keywords can be reordered. pw -N shows the result without updating the databases, and pw logs actions to /var/log/userlog. The Solnix page documents no dry-run option.
Source: FreeBSD pw(8) SYNOPSIS, DESCRIPTION, -N, NOTES; Solnix useradd(8) SYNOPSIS
NetBSDsupplementary group limitNetBSD -G takes a comma list or repeated options, with a maximum of 16 groups. Solnix -G is a comma list limited by NGROUPS_MAX, and duplicates with -g are ignored.
Source: NetBSD useradd(8) -G; Solnix useradd(8) -G

Everyday tasks

TaskSolnixLinuxFreeBSDNetBSD
add a user with a home directoryuseradd -m loginuseradd -m LOGINpw useradd name -museradd -m user
show the defaults for new usersuseradd -Duseradd -Dpw useradd -Duseradd -D
set the default login shelluseradd -D -s shelluseradd -D [options]pw useradd -D -s shelluseradd -D -s shell
add a user to supplementary groupsuseradd -G group[,group]... loginuseradd -G GROUP1[,GROUP2...] LOGINpw useradd name -G grouplistuseradd -G secondary-group user

Standards

  • POSIX: useradd is not a POSIX.1-2024 utility.

Writing portable scripts

  • Avoid -p, -K, -R, -P and -Z in portable scripts: they mean different things on Solnix, Linux and NetBSD. Create the account with a minimal useradd -m, then set the password afterwards with passwd(1).
  • Detect the tool (useradd or pw) and branch. Do not assume the default primary group, which is other on Solnix, per-user on Linux, and configured in usermgmt.conf on NetBSD.

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.