# Remove or revoke a device

_For tartan 0.9.36._

Pause a device, cut it off for good, or clear it from the list.

Pause a device, cut it off for good, or clear it from the list.

You need an Owner, Admin or Tech role. Device ids come from `tartan device list --org acme --json`.

## Choose what you want

| You want to | Command | Undo |
|---|---|---|
| Pause it (a laptop in for repair) | `device suspend` | `device resume` |
| Cut it off for good (lost, stolen, left the company) | `device revoke` | none |
| Turn away a device waiting for approval | `device deny` | it may join again with a new code |
| Clear a device with no live certificate from the list | `device forget` | `device restore`, while its address is free |

**Suspend** blocks the device's tunnel until someone resumes it. **Revoke** blocks its certificates at once and for
good, and the device is off your network in seconds. **Forget** archives a device that holds no live certificate: one
never approved, revoked, or long expired.

## In the console

Open **Devices** and select the device:

- an active device has **Suspend**, **Revoke** and **Rename**;
- a suspended one has **Resume** and **Revoke**;
- a revoked one has **Forget**;
- one **Waiting** for approval has **Approve** and **Deny**.

To act on several, tick their rows: **Suspend** and **Revoke** sit in the selection bar, **Resume** and **Forget** under
More. When the action steps up, one passkey approves the whole selection. Forgotten devices are under **Forgotten**,
with **Restore** while each can still be restored.

## With the CLI

Dry-run first, read what it says, then run it. When it steps up, your passkey approves it.

```sh
tartan device revoke --org acme --device <id> --dry-run --json
tartan device revoke --org acme --device <id> --json
```

The same shape works for `suspend`, `resume`, `deny`, `forget` and `restore`. Several devices at once, under one
passkey prompt when it steps up:

```sh
tartan batch run --file job.txt --dry-run --json
tartan batch run --file job.txt --json
```

with one line per device in `job.txt`, such as `device suspend --device <id>`.

## Give a computer to someone else

Release a revoked or suspended computer: its old key is retired for good, and the computer joins again with a new
code and a fresh key it makes itself. Release needs an Owner or Admin and has no dry run. Your passkey approves it.

```sh
tartan device release --org acme --device <id> --json
```

Then run the installer on the computer again with a new join code: [Your first device](first-device.md).

## A phone

The phone's user can leave from the app: **Networks**, the organization, **Leave this network**. Revoke it from your
side either way.

## Check it worked

```sh
tartan device show --org acme --device <id> --schema tartan.device.v1 --json
tartan device forgotten --org acme --json
```

`status` reads `suspended` or `revoked`. `device forgotten` lists forgotten devices and whether each can still be
restored.

## Next

- [Device codes and fleet pushes](device-codes.md)
- [The audit log](audit-log.md)
- [Your first device](first-device.md)
