> 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 -n <name>
```

### Flags

| Flag     | Short | Description                                            |
| -------- | ----- | ------------------------------------------------------ |
| `--name` | `-n`  | Display name for the machine (e.g., "My DGX Spark")    |
| `--org`  | `-o`  | Organization to register with (defaults to active org) |

### 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 with a name
brev register -n "My DGX Spark"

# Register to a specific organization
brev register --name "Lab Workstation" --org my-team
```

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

## brev enable-ssh

Enable SSH access on a registered machine for the current user. Prompts for the SSH port to use.

```bash
brev enable-ssh
```

### Flags

No flags. Prompts interactively for the SSH port.

### Details

* Grants SSH access to yourself (a "reflexive grant")
* Checks if the SSH daemon (`ssh` or `sshd`) is running and warns if it's not active
* Must be run on a registered machine

### Example

```bash
$ brev enable-ssh
Enter SSH port: 22
SSH enabled successfully.
```

## brev grant-ssh

Grant SSH access to another member of your organization. Presents an interactive selector to choose the user.

```bash
brev grant-ssh
```

### Flags

No flags. Interactive user selector. Prompts for SSH port.

### 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). This command removes `~/.brev/credentials.json` before granting access to prevent the other user from seeing the device owner's auth tokens.

## brev revoke-ssh

Revoke SSH access from a user. Presents an interactive selector showing Brev-managed SSH keys with a key preview and associated user.

```bash
brev revoke-ssh
```

### Flags

No flags. Interactive key selector.

### How it works

Revocation is two-stage:

1. Removes the SSH key from the local machine
2. Sends an RPC to the Brev server to revoke server-side access

### Example

```bash
$ brev revoke-ssh
Select a key to revoke:
> SHA256:abc123... (alice@example.com)
  SHA256:def456... (bob@example.com)
```

## brev deregister

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

```bash
brev deregister
```

### Flags

No flags. Prompts for confirmation.

### What it does

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

### Example

```bash
$ brev deregister
Are you sure you want to deregister this machine? [y/N]: y
Machine deregistered successfully.
```

## 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.