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

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, the organization is derived from the key.

Flags

FlagShortDescription
--name-nDevice name (e.g., my-dgx-spark); required in non-interactive mode
--org-oOrganization name; required in non-interactive mode unless using API key authentication
--approveSkip 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

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

brev enable-ssh

Flags

FlagDescription
--linux-userLinux user to enable SSH for; defaults to the current user in non-interactive mode
--ssh-portSSH 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

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.

brev grant-ssh

Flags

FlagDescription
--org, -oOrganization name; required in non-interactive mode unless using API key authentication
--node, -nMachine name; required in non-interactive mode
--user, -uBrev user ID or email; required in non-interactive mode
--linux-userLinux user on the target machine; defaults to the current local user
--port-idBrev port ID; required in non-interactive mode
--approveSkip 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

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

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, 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

brev revoke-ssh

brev deregister

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

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

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.

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