> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/brev/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/brev/_mcp/server.

# Brev Connect Commands

> CLI reference for setting up Brev Connect, managing SSH access, and deregistering machines from NVIDIA Brev.

Use these commands to set up Brev Connect on external hardware, manage SSH access, and deregister machines.

For connectivity commands (`brev shell` and `brev port-forward`) that also work with Brev Connect, see [Connectivity](/cli/connectivity).

## brev register

Register a Linux machine with your Brev organization. This installs the NetBird mesh VPN, profiles the machine's hardware, and registers it with the Brev API.

```bash
brev register
```

Without flags, registration prompts for a device name, organization, and confirmation. For non-interactive registration with user authentication, provide both `--name` and `--org`. With [API key authentication](/guides/api-keys), the organization is derived from the key.

### Flags

| Flag        | Short | Description                                                                             |
| ----------- | ----- | --------------------------------------------------------------------------------------- |
| `--name`    | `-n`  | Device name (e.g., `my-dgx-spark`); required in non-interactive mode                    |
| `--org`     | `-o`  | Organization name; required in non-interactive mode unless using API key authentication |
| `--approve` |       | Skip confirmation prompts                                                               |

Names must start with a letter or digit, contain only letters, digits, hyphens, underscores, or dots, and be at most 63 characters long.

### What it does

1. Installs the NetBird VPN agent via `https://pkgs.netbird.io/install.sh`
2. Collects a hardware profile — GPUs (NVML), CPU, RAM, storage, OS, interconnects
3. Registers the machine with the Brev API

### Example

```bash
# Register interactively
brev register

# Register to a specific organization
brev register --name my-dgx-spark --org my-team

# Register with an API key (organization resolved automatically)
brev register --name my-dgx-spark --api-key "$BREV_API_KEY"
```

Requires `sudo` access. Linux only. The NetBird agent is installed as a systemd service.

## brev enable-ssh

Enable SSH on a registered machine by installing the Brev certificate authority for a Linux user and opening the SSH port. Prompts for the Linux user and SSH port to use.

```bash
brev enable-ssh
```

### Flags

| Flag           | Description                                                                                      |
| -------------- | ------------------------------------------------------------------------------------------------ |
| `--linux-user` | Linux user to enable SSH for; defaults to the current user in non-interactive mode               |
| `--ssh-port`   | SSH destination port; the interactive prompt defaults to `22`. Required in non-interactive mode. |

### Details

* Enables the machine to accept Brev SSH certificates
* Run `brev grant-ssh` afterward to grant yourself or another org member access
* Must be run on a registered machine

### Example

```bash
brev enable-ssh --linux-user ubuntu --ssh-port 22
```

## brev grant-ssh

Grant SSH access to yourself or another member of your organization. Prompts for the organization, machine, port, Brev user, and Linux user. With API key authentication, the organization is derived from the key.

```bash
brev grant-ssh
```

### Flags

| Flag           | Description                                                                             |
| -------------- | --------------------------------------------------------------------------------------- |
| `--org`, `-o`  | Organization name; required in non-interactive mode unless using API key authentication |
| `--node`, `-n` | Machine name; required in non-interactive mode                                          |
| `--user`, `-u` | Brev user ID or email; required in non-interactive mode                                 |
| `--linux-user` | Linux user on the target machine; defaults to the current local user                    |
| `--port-id`    | Brev port ID; required in non-interactive mode                                          |
| `--approve`    | Skip confirmation                                                                       |

To find a `--port-id`, run the beta command `brev ports ls my-dgx-spark --json`, replacing `my-dgx-spark` with your machine name. Use the `port_id` of the entry whose `destination_port` matches the SSH port you enabled. You can also run `brev grant-ssh` without flags to select the port interactively.

### Example

```bash
$ brev grant-ssh
Select a user to grant SSH access:
> alice@example.com
  bob@example.com
```

Requires SSH to already be enabled on the device (run `brev enable-ssh` first). Select the same Linux user you enabled SSH for. Each person connecting uses their own Brev user login.

## brev revoke-ssh

Revoke SSH access from a user. Presents an interactive selector for the organization, machine, and access entry, including the Brev user, Linux user, and port.

```bash
brev revoke-ssh
```

### Flags

For non-interactive selection, provide `--org`, `--node`, `--user` (Brev user ID or email), `--linux-user`, and `--port-id`. Find the port ID as described under [brev grant-ssh](#brev-grant-ssh), or run `brev revoke-ssh` without flags to select an existing access entry. Add `--approve` to skip confirmation.

### How it works

Sends a request to the Brev server to revoke the selected SSH access entry.

### Example

```bash
brev revoke-ssh
```

## brev deregister

Remove the current machine from Brev. Performs a full cleanup.

```bash
brev deregister
```

### Flags

Prompts for confirmation. Use `--approve` to skip confirmation.

### What it does

1. Unregisters the machine from the Brev server
2. Removes the associated Brev SSH entries
3. Uninstalls the NetBird agent
4. Deletes `/etc/brev/device_registration.json`

### Example

```bash
brev deregister
```

## Using shell and port-forward with Brev Connect

The `brev shell` and `brev port-forward` commands work with Brev Connect machines. If a workspace with the given name isn't found, Brev automatically falls back to looking up connected external machines.

```bash
# SSH into a Brev Connect machine
brev shell my-dgx-spark

# Forward a port from a Brev Connect machine
brev port-forward my-dgx-spark --port 8888:8888
```

Port forwarding supports TCP and UDP protocols via the `OpenPort` RPC.