Skip to content
pols.so docs
Esc
↑↓navigate↵open⌘Jpreview
On this page

pols users

Manage a sandbox's Linux users

A sandbox has a default user, user (uid 1000, passwordless sudo). Add more Linux users so that several agents sharing one sandbox each work as their own user, with their own home: run commands as one with pols exec --user, write files it owns with pols cp --user and log in as one with pols ssh --user. Users live on the sandbox’s disk: they stay across stop, resume and standby, forks copy them and templates keep them.

This is Linux-level separation (separate homes and file permissions), not a security boundary between the users of one sandbox: a user with --sudo is root, and anyone with your org’s API keys can act as every user. Each user has a desktop of its own, with its own Chrome: pass --user to pols computer, pols browser cdp and pols desktop.

Usage

pols users [flags]
pols users [command]

Subcommands

Command Description
pols users add Add a Linux user to a running sandbox
pols users ls List a sandbox’s Linux users
pols users rm Remove a Linux user from a running sandbox

Flags

-h, --help   help for users

pols users add

Add a Linux user with its own group and home, /home/NAME. NAME is lowercase letters, digits, - and _, starting with a letter; system and reserved names (root, user, admin, docker, …) are refused. --ssh-key takes a public key or a .pub file and writes it to the user’s ~/.ssh/authorized_keys; logins through the pols SSH gateway use your org’s keys (pols ssh-key). While a fork or template of the sandbox is still being copied, users cannot be added; try again shortly.

Usage

pols users add SANDBOX NAME [flags]

Examples

pols users add web alice
pols users add web bob --sudo --ssh-key ~/.ssh/id_ed25519.pub

Flags

-h, --help                  help for add
    --shell string          login shell (default /bin/bash)
    --ssh-key stringArray   SSH public key, or a .pub file, for the user's authorized_keys (repeatable)
    --sudo                  give the user passwordless sudo (and the sudo and docker groups)

pols users ls

List a sandbox’s Linux users

Usage

pols users ls SANDBOX [flags]

Flags

-h, --help   help for ls

pols users rm

End the user’s processes and sessions and delete its account, group, sudo rights and home. The default user cannot be removed. While a fork or template of the sandbox is still being copied, users cannot be removed; try again shortly.

Usage

pols users rm SANDBOX NAME [flags]

Flags

-h, --help   help for rm

The global flags work with this command too.