.. _vyos.rest.vyos_user_module:
*******************
vyos.rest.vyos_user
*******************
**Manage user accounts on VyOS devices using REST API**
Version added: 1.0.0
.. contents::
:local:
:depth: 1
Synopsis
--------
- Manages local user accounts on VyOS devices via the REST API.
- Uses REST API (``connection=httpapi``) instead of CLI.
- Passwords are write-only. Once set, they cannot be read back in plaintext.
- Use ``update_password=on_create`` to avoid resetting passwords on every run.
Parameters
----------
.. raw:: html
| Parameter |
Choices/Defaults |
Comments |
|
state
string
|
Choices:
present ←
- absent
- gathered
|
present ensures users exist with the specified configuration.
absent removes specified users.
gathered returns current user configuration as structured data.
|
|
users
list
/ elements=dictionary
|
|
List of user definitions.
|
|
full_name
string
|
|
Full name of the user.
|
|
name
string
/ required
|
|
Username.
|
|
password
string
|
|
Plaintext password. Write-only — hashed on device immediately.
|
|
public_keys
list
/ elements=dictionary
|
|
SSH public keys for the user.
|
|
|
key
string
/ required
|
|
Base64-encoded public key.
|
|
|
name
string
/ required
|
|
Key identifier/name.
|
|
|
type
string
/ required
|
Choices:
- ssh-dss
- ssh-rsa
- ecdsa-sha2-nistp256
- ecdsa-sha2-nistp384
- ecdsa-sha2-nistp521
- ssh-ed25519
|
Key type.
|
|
update_password
string
|
Choices:
always ←
- on_create
|
Control when password is updated.
always updates the password on every run (default).
on_create only sets the password when the user is first created.
|