System users and SSH keys API
Create and manage the Linux accounts that own sites, their passwords, shells, sudo and SSH access, and add or remove SSH keys on one or many accounts through the OSS Panel API.
These endpoints are the API behind System Users in the panel's sidebar. A system user is a Linux account on the server. Every application is owned by one, and you can also create accounts for people who need SSH or SFTP access.
All paths are relative to https://<your-panel-host>/api. Read
Authentication first. The examples use:
PANEL=https://panel.example.com
TOKEN='1|xcMq8K3vZ2pL…'Permissions
Every endpoint here needs the system_user permission (System Users in
Roles). Reading needs view; every
endpoint marked manage needs manage, which implies view.
A caller with only view never receives a plaintext password: the password
field is null for them, and password_known still says whether one is set.
Endpoint index
| Method | Path | Permission | Limit per minute | Purpose |
|---|---|---|---|---|
GET | /system-users | view | shared | List accounts. |
POST | /system-users | manage | shared | Create an account. |
GET | /system-users/shells | view | shared | The shells you can pick. |
GET | /system-users/{systemUser} | view | shared | One account. |
DELETE | /system-users/{systemUser} | manage | shared | Delete one. |
DELETE | /system-users | manage | 6 | Delete several. |
PUT | /system-users/{systemUser}/password | manage | shared | Set the password. |
PUT | /system-users/{systemUser}/shell | manage | shared | Change the shell. |
PUT | /system-users/{systemUser}/ssh | manage | shared | Allow or refuse SSH sign-in. |
PUT | /system-users/{systemUser}/sudo | manage | shared | Give or take away sudo. |
GET | /system-users/{systemUser}/ssh-keys | view | shared | Keys on one account. |
POST | /system-users/{systemUser}/ssh-keys | manage | shared | Add a key to one account. |
DELETE | /system-users/{systemUser}/ssh-keys/{sshKey} | manage | shared | Remove a key from one account. |
GET | /ssh-keys | view | shared | Keys across all accounts. |
POST | /ssh-keys/deploy | manage | 30 | Add one key to several accounts. |
DELETE | /ssh-keys | manage | 30 | Remove a key from several accounts. |
The per-minute limits sit on top of the shared budget (see
Rate limits). {systemUser}
and {sshKey} are numeric ids. A key that is not on that account answers
404.
Accounts
GET /system-users
| Query | Rules |
|---|---|
search | Up to 255 characters; matches the username. |
sort | created_at or username; - for descending. |
page, per_page | per_page is one of 10, 20, 30, 50, 100. |
curl "$PANEL/api/system-users?sort=username" \
-H "Authorization: Bearer $TOKEN" -H 'Accept: application/json'{
"system_users": [
{
"id": 2,
"username": "shop",
"home_path": "/home/shop",
"shell": "/bin/bash",
"shell_title": "Bash",
"shell_allows_login": true,
"sudo": false,
"ssh_access": true,
"container_login": false,
"password": null,
"password_known": true,
"applications": [
{ "id": 12, "name": "shop", "domain": "shop.example.com" }
],
"created_at": "02-11-2026 09:14:03"
}
],
"meta": { "current_page": 1, "per_page": 10, "total": 1, "last_page": 1 }
}GET /system-users/{systemUser}
Returns {"system_user": { … }, "meta": {"ssh_access_enforced": true|false}}.
ssh_access_enforced tells you whether the server actually applies the
per-account SSH switch.
POST /system-users
Answers 201 with {"system_user": { … }}.
| Field | Rules |
|---|---|
username | Required: starts with a lower case letter or _, then lower case letters, digits, _ or -; 1 to 32 characters in all; not already used; not a reserved name. |
password | Optional. At least 10 characters with upper and lower case and a number. |
public_key | Optional: an SSH public key to add to the account. |
shell | Optional: /bin/bash, /bin/sh, /usr/bin/zsh, /usr/sbin/nologin or /bin/false, and installed on the server (see /system-users/shells). |
sudo | Optional boolean. |
ssh_access | Optional boolean. |
Reserved names: root, daemon, bin, sys, sync, games, man, lp,
mail, news, uucp, proxy, www-data, backup, list, irc,
gnats, nobody, systemd-network, mysql, postgres, mongodb,
redis, ubuntu, admin and sshd.
curl -X POST "$PANEL/api/system-users" \
-H "Authorization: Bearer $TOKEN" -H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{"username": "deploy", "ssh_access": true, "public_key": "ssh-ed25519 AAAA… ci@example.com"}'GET /system-users/shells
Returns {"shells": [ … ]}: the shells installed on the server.
PUT /system-users/{systemUser}/password
Body {"password": "…"}: at least 10 characters with upper and lower case
and a number, with no control characters. Answers 204.
PUT /system-users/{systemUser}/shell
Body {"shell": "/bin/bash"}: one of the shells above that is installed. Returns
{"system_user": { … }}.
PUT /system-users/{systemUser}/ssh
Body {"ssh_access": true} (required boolean). Returns
{"system_user": { … }}.
PUT /system-users/{systemUser}/sudo
Body {"sudo": true} (required boolean). Returns {"system_user": { … }}.
DELETE /system-users/{systemUser}
Deletes the account and its home folder. Optional body end_sessions
(boolean): end the account's running processes first. Answers 204.
Refused with 422 when an application still belongs to the account (on
system_user), and when the account has running processes and you did not ask
to end them.
DELETE /system-users
Body:
| Field | Rules |
|---|---|
ids | Required array of 1 to 50 distinct existing ids. |
end_sessions | Optional boolean, as for one account. |
Returns {"deleted": true|false, …} with the ids that failed and why.
SSH keys on one account
GET /system-users/{systemUser}/ssh-keys
Returns {"ssh_keys": [ … ]}, newest first. A key has id, name,
fingerprint, type, system_user and timestamps.
POST /system-users/{systemUser}/ssh-keys
| Field | Rules |
|---|---|
name | Required, up to 255 characters. |
public_key | Required: a valid SSH public key line. |
Answers 201 with {"ssh_key": { … }, "existing": false}. If the account
already has that key you get 200 with "existing": true and a message.
DELETE /system-users/{systemUser}/ssh-keys/{sshKey}
Answers 204.
SSH keys across accounts
GET /ssh-keys
Optional filters fingerprint and system_user_id. Returns
{"ssh_keys": [ … ]} for all accounts, ordered by account.
POST /ssh-keys/deploy
Adds one key to several accounts.
| Field | Rules |
|---|---|
name | Required, up to 255 characters. |
public_key | Required, a valid SSH public key. |
system_user_ids | Required array of 1 to 100 distinct existing ids. |
{
"results": [
{
"system_user": { "id": 2, "username": "shop" },
"status": "added",
"ssh_key_id": 7,
"warnings": []
}
],
"warnings": []
}status is added, existing or failed (with a reference). A per-account
warning ssh_access_off means the key was added but that account is not
allowed to sign in over SSH; the top-level warning ssh_port_closed means
the server's firewall has the SSH port closed.
DELETE /ssh-keys
Removes a key from several accounts.
| Field | Rules |
|---|---|
fingerprint | Required: SHA256: followed by 43 characters. |
system_user_ids | Optional array of 1 to 100 distinct ids. Leave out to remove the key everywhere. |
Returns {"results": [ … ]}, one row per account with status removed or
failed (with a reference).
Common errors
| Status | Message or cause |
|---|---|
403 | Your role does not include management for System Users. |
404 | Unknown account or key. |
422 | Validation ({"message", "errors": {"field": ["…"]}}), including an account that still owns an application. |
429 | Over a limit; wait for Retry-After. |
500 | {"message", "reference"}: find the reference in the error log. |
Related
- Applications API:
generate_system_useron create - System users
Docker API
Docker networks and volumes, containerised databases, resource limits and image lookup through the OSS Panel API.
Firewall and Fail2ban API
Read and change the server firewall rules, switch the firewall on or off, and manage Fail2ban settings, the ignore list and bans through the OSS Panel API.