LinuxCommandLibrary

cockpit-bridge

Connect Cockpit web interface to system services

TLDR

List all cockpit packages

$ cockpit-bridge --packages
copy

Display help
$ cockpit-bridge --help
copy

SYNOPSIS

cockpit-bridge [--help] [--version] [--for-peer UID:PID] [--host-uid UID] [--host-pid PID] [--interactive] [--no-api] [--packages PATH] [--service SERVICE]

PARAMETERS

--help
    Print help and exit

--version
    Print version and exit

--for-peer UID:PID
    Connect to specific peer process

--host-uid UID
    UID for host services

--host-pid PID
    PID of host process

--interactive
    Run interactively for debugging

--no-api
    Skip standard API registration

--packages PATH
    Custom packages search path

--service SERVICE
    Run only named service (e.g., shell)

DESCRIPTION

cockpit-bridge is the core server-side process in the Cockpit web console, enabling remote Linux server administration via a web browser. It serves as a secure bridge between the frontend cockpit-ws WebSocket proxy and system resources, handling user sessions, authentication, and API exposure over DBus.

Upon login, cockpit-ws spawns a per-session cockpit-bridge instance, which loads packages from /usr/share/cockpit or custom paths. It provides APIs for managing storage, networking, services, users, logs, and more, with sandboxing via unshare() for security. Supports multi-host management and integrates with systemd.

Direct invocation is rare, mainly for testing or specific services like shell or storage. It logs to journald and exits on session end or errors. Essential for Cockpit's real-time, no-plugin architecture.

CAVEATS

Requires cockpit package; runs privileged; direct use insecure without sandbox. Logs errors to journalctl -u cockpit.

EXIT CODES

0: success
1: general error
64+: specific failures (e.g., auth)

DEBUGGING

Use --interactive and COCKPIT_DEBUG=all env var; check journalctl -u cockpit-bridge.service

HISTORY

Part of Cockpit project by Red Hat/Projekktor (2014); evolved for systemd integration, multi-host support in v200+.

SEE ALSO

Copied to clipboard