Skip to content

SSH

SSH (Secure Shell) is the standard way to get a command-line session on a Linux or Unix server. With the Bridge, users reach those servers through a brokered SSH session that is policy-controlled and fully recorded - they never need the server’s real credentials.

You can offer SSH two ways, and you can use either or both:

  • Native mode - users connect with the regular ssh command (or PuTTY, MobaXterm, an IDE’s remote terminal, etc.) pointed at a port on the Bridge.
  • Browser mode - users open a terminal right inside the Bridge web interface. Nothing to install.

Granting access. Settings here enable SSH for the deployment. To grant a person access to a host, create a checkout - see the SSH credentials, command filtering, and a worked example.

Native mode

Turn on native mode and pick a port for the Bridge to listen on. Port 22 is the conventional SSH port.

bridge.yaml
ssh:
  native:
    enabled: true
    listen: "22"

A user then connects the way they always have, but to the Bridge’s address:

ssh 'alice%server.internal'@bridge.example.com

For native SSH, Bridge routes the session from the SSH username. Use <bridge-user>%<target-host> so Bridge can match the checkout and connect to the approved target.

A checkout normally carries a private_key or a target_password for the backend login. If it carries neither, set ldap_auth_passthrough and Bridge logs in with the directory password the user gave it - for hosts where access comes from a directory group (AD/SSSD) rather than a stored account.

If the user authenticates to Bridge with a public key, Bridge has no directory password to reuse. It continues SSH authentication with a masked prompt for the target password. A stored private key or target password takes precedence and does not trigger this prompt.

Host keys

Every SSH server presents a host key - a fingerprint that lets a client confirm it is talking to the same server as last time, not an impostor. The Bridge needs its own host key for native SSH.

By default the Bridge generates and stores one automatically. If you run several Bridge replicas behind a load balancer, each would otherwise generate a different key, and users would see scary “host key changed” warnings depending on which replica they hit. To avoid that, give all replicas the same host key seed so they derive the same, stable fingerprint.

bridge.yaml
ssh:
  native:
    enabled: true
    listen: "22"
    host_key_path: "/data/keys/host_key"
    host_key_auto_generate: true
    host_key_seed: "a-long-shared-secret-string"

The host key seed can also be supplied with the BRIDGE_HOST_KEY_SEED environment variable, which is usually the cleaner choice for a clustered deployment. Use the same value on every replica.

Login attempts and banner

You can limit how many times a user may try to authenticate before the connection is dropped, set the SSH version string the Bridge advertises, and show a banner (a message displayed before login).

bridge.yaml
ssh:
  native:
    enabled: true
    listen: "22"
    max_auth_tries: 3
    server_version: "SSH-2.0-BritiveBridge"
    banner: "Authorized use only. All sessions are recorded."

Browser mode

Browser mode gives users an SSH terminal inside the web interface. You can tune how that terminal looks and how much scrollback history it keeps.

bridge.yaml
ssh:
  browser:
    enabled: true
    font_name: "monospace"
    font_size: 14
    color_scheme: "gray-black"
    scrollback: 5000

scrollback is the number of past lines a user can scroll back through in the terminal.

Shared options

These apply to both modes.

bridge.yaml
ssh:
  idle_timeout: 30m
  allow_insecure_host_key: true

allow_insecure_host_key controls whether the Bridge verifies the target server’s host key when it connects out to it. Left at the default (true) the Bridge does not verify it. That suits just-in-time targets, whose host keys are not known before the session exists, but it means the Bridge connects even when a target’s identity cannot be confirmed.

Setting it to false does not give native SSH stricter verification. It stops native SSH working. There is no known-hosts file and no pinned-key path, so the strict branch has nothing to compare a key against and refuses every one. Browser SSH is different: false there leaves verification to the rendering gateway, which does check.

So on a Bridge serving native SSH, true is the only working value today. If you need the target’s identity confirmed on the native path, say so - it needs a known-hosts or pinned-key mechanism that does not exist yet.

Examples

Users connect with their own ssh client; no browser terminal.

bridge.yaml
ssh:
  idle_timeout: 30m
  native:
    enabled: true
    listen: "22"
    max_auth_tries: 3

Option reference

OptionTypeDefaultDescription
ssh.idle_timeoutduration30mClose a session after this much inactivity.
ssh.allow_insecure_host_keybooltrueSkip verification of the target server’s host key. false breaks native SSH rather than tightening it - see the note above.
ssh.native.enabledboolfalseTurn on native SSH (a listening port).
ssh.native.listenstring (port)22Port the Bridge listens on. Required when native is enabled.
ssh.native.host_key_pathstring/data/keys/host_keyWhere the Bridge’s host key is stored.
ssh.native.host_key_auto_generatebooltrueGenerate a host key automatically if none exists.
ssh.native.host_key_seedstring""Seed for a deterministic, stable host key across replicas. Env: BRIDGE_HOST_KEY_SEED.
ssh.native.max_auth_triesint3Maximum authentication attempts before disconnect. Raised to a floor of 50 in practice. See the note after this table.
ssh.native.server_versionstringSSH-2.0-BritiveBridgeSSH version string the Bridge advertises.
ssh.native.bannerstring""Message shown before login.
ssh.browser.enabledboolfalseTurn on the in-browser SSH terminal.
ssh.browser.font_namestringmonospaceTerminal font.
ssh.browser.font_sizeint14Terminal font size.
ssh.browser.color_schemestringgray-blackTerminal color scheme.
ssh.browser.scrollbackint5000Lines of scrollback history.

max_auth_tries does not act as a brute-force limit. Bridge raises any value below 50 to 50 whenever password authentication is available, which is every working deployment. The raise is written to the log with both the configured and the effective value. Set the setting to 50 or higher and your value is used unchanged.

The raise exists because a rejected key offer costs an attempt. An SSH client offers every key its agent holds before it tries a password, Bridge rejects each key that is not the one on the checkout, and each rejection counts. A limit of N therefore tolerates N-1 unusable keys: at 3 the fourth key never gets asked for a password, and an agent with three keys is enough to break a password-authenticated session. At 50 the tolerance is 49 keys.

Two reasons this is not the security control the name suggests. The limit is per connection, and Bridge does not rate-limit connections or lock an identity out, so reconnecting starts the count again. To bound authentication attempts against a target, use the target’s own controls.

Last updated on