Skip to main content

org.osbuild.users

Add or modify user accounts

WARNING: This stage uses chroot() to run the useradd or usermod binary from inside the tree. This will fail for cross-arch builds and may fail or misbehave if the usermod/useradd binary inside the tree makes incorrect assumptions about its host system. When an existing user is modified the mkhomedir_helper(8) program is run inside a chroot to ensure that a home dir exists for the user, as usermod does not create it (it will move existing dirs though).

Schema 1

{}

Schema 2

{
"options": {
"additionalProperties": false,
"properties": {
"users": {
"additionalProperties": false,
"type": "object",
"description": "Keys are usernames, values are objects giving user info.",
"patternProperties": {
"^[A-Za-z0-9_.][A-Za-z0-9_.-]{0,31}$": {
"type": "object",
"properties": {
"uid": {
"description": "User UID",
"type": "number"
},
"gid": {
"description": "User GID",
"type": "number"
},
"groups": {
"description": "Array of group names for this user",
"type": "array",
"items": {
"type": "string"
}
},
"description": {
"description": "User account description (or full name)",
"type": "string"
},
"home": {
"description": "Path to user's home directory",
"type": "string"
},
"shell": {
"description": "User's login shell",
"type": "string"
},
"password": {
"description": "User's encrypted password, as returned by crypt(3)",
"type": "string"
},
"key": {
"description": "SSH Public Key to add to ~/.ssh/authorized_keys",
"type": "string"
},
"keys": {
"description": "Array of SSH Public Keys to add to ~/.ssh/authorized_keys",
"type": "array",
"items": {
"type": "string"
}
},
"expiredate": {
"description": "The date on which the user account will be disabled. This date is represented as a number of days since January 1st, 1970.",
"type": "integer"
},
"force_password_reset": {
"description": "Force this user to change their password on first login",
"type": "boolean"
}
}
}
}
}
}
},
"devices": {
"type": "object",
"additionalProperties": true
},
"mounts": {
"type": "array"
}
}