Users and groups
[bootstrap.groups] and [bootstrap.users] declare local accounts on Linux and macOS, such as a service user and its groups. mise applies them before it writes system files, so a file can name an account from the same config as its owner.
Example
This creates a system user for a cache service, with its own group and read access to container logs through a second group:
[bootstrap.groups.mise-cache]
system = true
[bootstrap.groups.container-readers]
system = true
[bootstrap.users.mise-cache]
system = true
group = "mise-cache"
groups = ["container-readers"]
home = "/var/lib/mise-cache"
shell = "/usr/sbin/nologin"
comment = "mise cache service"
create_home = truePreview the changes, then apply them:
mise bootstrap accounts apply --dry-run
mise bootstrap accounts applyFor macOS, see On macOS.
Before you apply
Applying changes needs root. Unless you are already root, mise starts a privileged copy of itself with sudo. On Linux that copy runs the shadow-utils commands groupadd, groupmod, groupdel, useradd, usermod, and userdel. sudo can prompt for a password in an interactive terminal; otherwise mise needs passwordless sudo. system_packages.sudo = false forbids elevation, so only root can apply. Names reach these commands as arguments, never through a shell.
Minimal images may lack those commands, and mise then stops with required account command 'useradd' was not found. Install the package that provides them, such as shadow on Alpine. On macOS the copy runs dscl and dseditgroup instead; see On macOS.
Change existing accounts
mise manages only the fields you set and leaves the rest of an account as it is. Inspect the dry run before you change an account that already exists: UID, GID, and group changes affect the account database even for files outside this config.
uidandgidpin numeric IDs. If the requested ID belongs to another account, mise reports the resource asunknownand does not apply it.- On Linux, changing an existing user's
uidor primarygrouprunsusermod, which also re-owns that user's files inside the home directory and mail spool. Files elsewhere keep the old IDs, and mise does not rewrite them. macOS never renumbers an existing account; see On macOS. - On Linux, changing a group's
gidupdates the group database only. system = truepicks the system ID range when mise creates an account. It does not reclassify an account that already exists.groupsadds missing supplementary groups and keeps memberships that are not listed. Withexclusive_groups = true, the list is exact, andgroups = []removes every supplementary membership.- Changing
homeupdates only the account entry, unless you also setmove_home = trueto move the existing directory. - mise does not change the UID 0 user or the GID 0 group. One that differs from its declaration is reported as
unknown, and apply fails.
How configs combine
When several config files declare the same user or group, the most local declaration is used as a whole; mise does not merge fields across files.
Within a run, mise creates and updates groups before users, and accounts before the system files and directories that name them as owner or group. Removals run in the other order: users before the groups they depend on. mise bootstrap plan shows these dependencies.
Remove users and groups
Deleting a declaration leaves the account in place. To remove an account, declare it absent:
[bootstrap.users.old-service]
state = "absent"
remove_home = true
[bootstrap.groups.old-service]
state = "absent"mise keeps a user's home directory unless you set remove_home = true, which also deletes the mail spool. remove_home works only on Linux: on macOS, leave it out and delete the home directory yourself after the user is removed. mise refuses to remove UID 0, GID 0, or the user running mise, and the operating system's own checks still apply; for example, groupdel rejects a group that is still another user's primary group.
Preview and apply
mise bootstrap accounts status
mise bootstrap accounts status --json
mise bootstrap accounts apply --dry-run
mise bootstrap accounts apply --yesmise bootstrap applies accounts first, before every other part. To use a new account as a file owner with --only, include both parts: mise bootstrap --only accounts,files.
Reference
Account names use at most 32 ASCII letters, digits, _, or -, start with a letter or _, and may end with $. A user's group and groups may also name an existing group with dots, such as macOS's com.apple.access_ssh. Two present accounts of the same kind cannot declare the same uid or gid.
User fields:
| Field | Default | Effect |
|---|---|---|
group | Required, unless state = "absent" | Primary group. Declare it in the same config or have it exist on the host |
groups | Not managed | Supplementary groups to add |
exclusive_groups | false | Remove supplementary groups that groups does not list; needs groups |
uid | Not managed | Numeric user ID |
home | Not managed | Home directory, as an absolute path without .. |
create_home | true, or false with system = true | Create the home directory for a new user |
move_home | false | Move the existing home directory when home changes; needs home |
shell | Not managed | Login shell, as an absolute path without .. |
comment | Not managed | Comment (GECOS) field, or RealName on macOS, without : or line breaks |
system | false | Create the user in the system ID range |
state | "present" | "absent" removes the user; it then takes only remove_home |
remove_home | false | With state = "absent", also delete the home directory and mail spool |
hidden | Not managed | macOS only: hide the user from the login window and user lists |
Group fields:
| Field | Default | Effect |
|---|---|---|
gid | Not managed | Numeric group ID |
system | false | Create the group in the system ID range |
state | "present" | "absent" removes the group; it then cannot set gid or system |
On macOS
mise manages local accounts on macOS through Directory Services: the privileged copy runs dscl . to create, change, and delete user and group records and dseditgroup to change memberships, so the accounts land in the local node, as sysadminctl or System Settings would put them. This declares a service account for a LaunchDaemon:
[bootstrap.groups.mise-ci]
gid = 450
[bootstrap.users.mise-ci]
uid = 450
group = "mise-ci"
home = "/opt/mise-ci/home"
shell = "/usr/bin/false"
comment = "mise CI"
hidden = true
[bootstrap.directories."/opt/mise-ci/work"]
owner = "mise-ci"
group = "mise-ci"
mode = "0750"One mise bootstrap creates the group, then the user, then the directory it owns. The account differs from one that macOS creates for a person:
- It has no password (
Passwordis*), so nobody can log in as it with a password; launchd'sUserNamekey needs none, and mise never sets one. That does not block SSH public-key login, and a shell such as/usr/bin/falsedoes not block port forwarding. To deny SSH, limit Remote Login to thecom.apple.access_sshgroup and leave the account out of it, or list the account in sshd'sDenyUsers. - It is not an administrator. mise adds the user only to the groups in
groups, so it joinsadminonly if you listadmin. hidden = truesetsIsHidden, which keeps the account out of the login window and the Users & Groups list.hidden = falsesetsIsHiddento0; other macOS settings, such as the login window'sHide500Users, can still hide the account.- With
homeset, mise creates that directory for a new user, mode0700, owned by the user and its group, unlesscreate_home = false. A directory that already exists is used as it is: mise does not change its owner or mode. Withouthome, the home directory is/var/empty, as for Apple's own service accounts. - A user or group that macOS finds only through a directory service, such as LDAP, and not in the local node shows as
unknown: mise edits only local accounts. So does a user that would be created or changed with such a group as its primary group or ingroups.
Some fields work differently on macOS:
uidandgidare required to create a user or group, becausedscldoes not choose IDs, and does not stop two records from sharing one. Pick an ID that no account uses: Apple's own accounts use IDs below 500 and add new ones in macOS updates, and people's accounts start at 501. If the ID is taken, mise reports the resource asunknownand does not apply it.- mise does not change the
uidorgidof an existing account. A declaration whose ID differs from the account's is reported asunknown, and apply fails. groupscompares and adds direct memberships, the ones a group lists inGroupMembership. Memberships that macOS grants to every account, such aseveryoneandlocalaccounts, are neither listed nor compared.- If creating an account fails partway, mise deletes the half-written record, any group memberships it gained, and the home directory it just created if that is still empty, so the next run creates it again. Anything it could not undo is named in the error. A new user's home directory is created before its record.
- Right before it writes, mise checks again that the record is still missing, that no other record has taken its UID or GID, that the primary group still has the planned GID, and that every group in
groupsis in the local directory node, which is the only one it edits. Before updating a user, it checks that the name still has the user's UID, and it adds only the memberships the user lacks at that moment. Two runs of mise never write accounts at the same time. - Removing a user also takes it out of every group that lists it. Removing a group fails while it is still a user's primary group.
system,exclusive_groups,move_home, andremove_homefail on macOS rather than being ignored.hiddenfails on Linux.
On Windows
Accounts are supported on Linux and macOS only. On another platform, mise bootstrap, mise bootstrap status, and mise bootstrap plan ignore these declarations with a warning, so one config can serve several platforms, while the explicit mise bootstrap accounts commands fail instead of doing nothing. When a system file or directory names one of the ignored accounts as its owner or group, that field is ignored with a warning too; the file's content, mode, and any other owner or group are still applied.
See also
- Bootstrap for where accounts fall in the run order.
- System files and directories for files owned by these accounts.