Skip to Content
Building OsUser Management

User Management

Create and configure system users as part of your build.

User Configuration

Basic User

{ "username": "deploy", "shell": "/bin/bash" }

User with Groups

{ "username": "admin", "shell": "/bin/bash", "groups": ["sudo", "docker", "adm"] }

Full Configuration

{ "username": "operator", "shell": "/bin/bash", "groups": ["sudo", "docker"], "home": "/home/operator", "comment": "System operator account", "vyattaLevel": "admin" }

Configuration Options

OptionTypeRequiredDescription
usernamestringYesLogin username
shellstringNoLogin shell (default: /bin/bash)
groupsarrayNoAdditional group memberships
homestringNoHome directory path
commentstringNoUser description (GECOS)
vyattaLevelstringNoVyatta access level (Elster OS only)

Common Groups

GroupPurpose
sudoAdministrative privileges
dockerDocker access without sudo
admSystem log access
wheelAlternative admin group (Fedora)
libvirtVM management access
kvmKVM virtualization access

Vyatta Levels (Elster OS)

Elster OS uses Vyatta configuration levels:

LevelAccess
adminFull configuration access
operatorOperational commands only
userLimited read-only access

Example:

{ "username": "netadmin", "groups": ["vyattacfg"], "vyattaLevel": "admin" }

Natural Language Examples

Single User

Create a user called "deploy" with sudo and docker access

Multiple Users

Create these users: - admin: sudo access, bash shell - deploy: docker group only - monitor: read-only, no shell (/usr/sbin/nologin)

Service Account

Create a system user "appservice" for running the application with no login shell and home directory at /opt/app

Password Management

For security, OpenFactory does not set passwords in the build. Instead:

SSH Key Authentication

Create user "admin" with SSH key authentication only

Keys can be:

  • Added during first boot
  • Managed via cloud-init
  • Configured via startup script

First-Boot Password

User should set password on first login

This creates the user with an expired password, forcing a change.

Default Users

Some base images include default users:

Base ImageDefault UserPurpose
Elster OSvyosVyatta configuration
UbuntuubuntuCloud-init default

You can modify or remove these default users in your configuration.

User Verification

OpenFactory tests user configuration:

{ "type": "user_exists", "params": { "username": "deploy", "groups": ["docker"] } }

This verifies:

  • User account exists
  • Correct group memberships
  • Shell configuration
  • Home directory created

Best Practices

  1. Minimal privileges - Only add necessary groups
  2. No shared accounts - Create individual users
  3. Service accounts - Use nologin shell for services
  4. Document users - Use comment field for descriptions
  5. Key-based auth - Disable password authentication