---
title: "pols users"
description: "Manage a sandbox's Linux users"
---

<!-- Generated by scripts/reference.mjs from the pols CLI's --help. Do not edit; run `npm run reference:sync`. -->

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

```text
pols users [flags]
pols users [command]
```

## Subcommands

| Command | Description |
| --- | --- |
| [`pols users add`](#pols-users-add) | Add a Linux user to a running sandbox |
| [`pols users ls`](#pols-users-ls) | List a sandbox's Linux users |
| [`pols users rm`](#pols-users-rm) | Remove a Linux user from a running sandbox |

## Flags

```text
-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

```text
pols users add SANDBOX NAME [flags]
```

### Examples

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

### Flags

```text
-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

```text
pols users ls SANDBOX [flags]
```

### Flags

```text
-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

```text
pols users rm SANDBOX NAME [flags]
```

### Flags

```text
-h, --help   help for rm
```

The [global flags](/docs/reference/cli/#global-flags) work with this command too.
