All posts Feature

NDCLI 1.51.0 Opens the WebAdmin of device connect in Your Browser

FEATURE 3 MIN READ NETDEFENSE TEAM

ndcli device connect opens a shell on the firewall and a local tunnel to its WebAdmin, then prints the tunnel’s one-time link for you to open. NDCLI 1.51.0 adds two flags that pick what you open: --browser opens the WebAdmin straight in your default browser, and --shell opens only the shell.

TL;DR

  • device connect --browser opens only the WebAdmin tunnel, and its link opens in your default browser.
  • device connect --shell opens only the shell. It needs a terminal.
  • --browser --shell opens both, and the link opens in your browser. Plain device connect works as before.
  • --no-webadmin and --webadmin-only still work, as deprecated aliases that open no browser.
  • Upgrade NDCLI to 1.51.0 with Homebrew, Scoop or the release download.

Pick what you open

Command Shell WebAdmin tunnel Link
ndcli device connect fw-hq yes yes printed
ndcli device connect fw-hq --browser no yes opens in your browser
ndcli device connect fw-hq --shell yes no none
ndcli device connect fw-hq --browser --shell yes yes opens in your browser

To get to the firewall’s web interface, one command does it:

ndcli bash
$ ndcli device connect fw-hq --browser

With --browser alone there is no shell, and the tunnel stays open until you press Ctrl-C. With --browser --shell, the tunnel stays open after the shell exits, until you press Ctrl-C at the keep-alive prompt, as it does with plain device connect.

--shell needs a terminal on stdin and stdout. In a script, or under nohup, it fails with --shell needs a terminal on stdin and stdout instead of falling back to the tunnel the way plain device connect does.

The link still works once, as in NDCLI 1.50.3: with --browser, your default browser spends it, so the printed link then opens in no other browser. To use a different browser, connect without --browser and paste the link there.

When no browser opens

On Linux without a display, or over SSH without a forwarded display, ndcli opens no browser and says so on stderr. The link is printed either way, so you can copy it to a browser yourself.

On a shared machine, connect without --browser

To open the link, ndcli hands it to the system’s opener on its command line. For the moment before the browser spends it, another user of the same machine can read it in the process list, spend it first and take the session, which locks your browser out. Where other people use the machine, run device connect without --browser and paste the link yourself.

The older flags

--no-webadmin and --webadmin-only keep working, as deprecated aliases of --shell and --browser, and ndcli prints a deprecation notice when you use them. Neither opens a browser, so scripts that use them behave as before. A script doesn’t need --webadmin-only at all: when stdin or stdout isn’t a terminal, plain device connect skips the shell and keeps the tunnel, and it prints the tunnel’s link on stderr when stdout isn’t a terminal.

Upgrade to 1.51.0

macOS / Linux (Homebrew) bash
$ brew upgrade ndcli
Windows (Scoop) powershell
$ scoop update ndcli

Or download the binary from the NDCLI 1.51.0 release, as in Installation. Run ndcli version to check you have it.

The device connect reference has the command’s flags, and Remote Access covers remote sessions in general.

Related reading

Security Security Fixes From Our November Security Review: Agent 1.33.0 and ndcli 1.52.0
Guide How to Reach an OPNsense Firewall Behind CGNAT Without Opening a Port
Guide How to Roll Out OPNsense Updates Across a Fleet in Stages

Enjoyed this post? Explore more in the documentation.