Brev Connect Commands

View as Markdown

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.

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.

$brev register -n <name>

Flags

FlagShortDescription
--name-nDisplay name for the machine (e.g., “My DGX Spark”)
--org-oOrganization 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

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

$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

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

$brev grant-ssh

Flags

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

Example

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

$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

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

$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

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

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