ドキュメント

cockpit remote-access

cockpit remote-accessの構文、オプション、結果、制約をcockpit CLIの正本から自動生成したリファレンスです。

対象
CLI
WindowsmacOSLinux
無料AGIラボ会員

最終検証 2026-08-27 · v4.61.0

Markdown

最新バージョンでは、画面や操作が一部異なる場合があります。

このReference本文は、アプリが配布するcockpit CLIヘルプと同じ英語の正本から自動生成されています。日本語の概念説明と安全な使い方はcockpit CLIを参照してください。

Manage local Remote Access configuration and runtime together.

cockpit remote-access status [--verbose]
cockpit remote-access configure [--port <1024-65535>] [--scope tailscale|local] [--https true|false] [--keep-awake true|false] [--confirm-local-network]
cockpit remote-access enable [--confirm-local-network]
cockpit remote-access disable --confirm
cockpit remote-access paired list
cockpit remote-access paired revoke <id>
cockpit remote-access certificate status|generate
cockpit remote-access tailscale status

Configuration is rejected while the server is running or starting. General desktop settings saves preserve the current Remote Access configuration; the desktop HTTPS and keep-awake controls submit only the preference explicitly changed. It saves the port, scope, HTTPS and keep-awake values and keeps the persisted mode: it never turns Remote Access on or off. While Remote Access is paused, configuration is allowed without membership verification, the pause stays, and the next resume uses the new values. Local-network scope requires --confirm-local-network for both configuration and every enable, and --scope local cannot be combined with --https true: the pair returns constraint_violated because HTTPS depends on a Tailscale certificate. Disabling requires --confirm because it ends every connected session and persists standalone mode, which cannot be undone from a remote device. Enable, certificate generation, and configuration of an install whose persisted mode is already server and that is not paused force membership verification. Status, disable, certificate status, Tailscale status, and configuration of a standalone install do not.

--keep-awake true keeps the computer awake while Remote Access is running, so a laptop stays reachable after its display turns off. It never blocks display sleep, and it is released when Remote Access stops, when it is set back to false, and when the app quits. status reports the stored value as configured.keepAwake and the live assertion as runtime.keepingAwake. On battery the computer keeps draining while the assertion is held.

The PWA connects through AGI Lab sign-in using the same account as this PC. An already signed-in browser tries prompt=none automatically. The PC accepts sign-in starts only for its own configured HTTPS domain or Tailscale IP, plus its LAN IPs when local access is enabled, at the configured port. The return path is fixed at /agi-labo/callback. HTTP ts.net addresses are supported; .local addresses are not. Open a listed Tailscale or LAN IP address instead. A browser on this PC connects the same way; this PC's own addresses share one start limit and, like Tailscale ownership, never grant owner authority by themselves. When local access is off, starts from outside Tailscale return tailscale_required. Clicking Sign in with AGI Lab to connect always starts a new request that asks AGI Lab to sign in again (prompt=login), so a browser signed in to another account can switch accounts; this may also sign that browser out of AGI Lab in its other tabs. The automatic check never signs out.

A PWA shown inside another page, such as the desktop's view of another device's task, starts only when Sign in with AGI Lab to connect is clicked: the normal browser opens this PC's confirmation page, and the view receives its connection through a private result secret, as cockpit ask pair --sign-in does. That confirmation page, used for CLI and embedded starts only, names this PC and its address, cannot be framed, and continues to AGI Lab only after a same-origin POST; opening it does not use up the request. An open PWA tab never shows it.

paired list returns connection IDs, whether each used sign-in or legacy pairing, browser/CLI type, and creation time when available. It never returns tokens or token hashes. If pairing-credentials.json cannot be read, at startup or later, paired list and paired revoke return HTTP 503 pairing_store_unavailable, no connection is accepted or created (including connections carried over an update restart), and the file is left unchanged; a browser keeps its saved token and connects again once the file can be read. If the sign-in connections revoked at sign-out cannot be removed from that file, Cockpit records the pending revocation in its app data folder, and Remote Access does not start until they are removed. If that record cannot be written either, Remote Access stays off until they are removed while Cockpit keeps running; after Cockpit restarts, revoke the remaining sign-in connections with paired revoke. paired revoke <id> returns {revoked: true|false}, persists the revocation and immediately disconnects that connection. The desktop Remote Access screen provides the same list and revoke action, including while Remote Access is off.

Remote Access requires an AGI Lab membership. A guest receives HTTP 401 with sign-in-required and an invitation to sign in with a member account. An expired or revoked sign-in session receives HTTP 401 with authentication-required and asks for sign-in again; an inactive membership receives HTTP 403 with membership-required. These failures pause Remote Access: a running server stops, but the saved configuration stays as it was, including configured.mode: server, port, scope, HTTPS and keep-awake. A temporarily unavailable membership verifier returns HTTP 503 with membership-verification-unavailable and preserves a running server and its persisted mode. Status reports the guest as membership.state: sign-in-required and never exposes session IDs, tokens, user agents, or authorized token sets.

Remote Access pauses when the AGI Lab sign-in ends (sign-out, a session pushed out by another sign-in, or an expired session) or when the membership is no longer active, and also at launch when the saved mode is server but there is no sign-in or membership. The pause, its reason and its time survive restarts, and the desktop shows one notification when Remote Access pauses for the sign-in or the membership. After signing in again and passing membership verification, Remote Access resumes by itself with the saved configuration, running the same checks as enable, including the HTTPS certificate. Code-issued PWA and CLI credentials stay valid through the pause. Sign-in-issued credentials are revoked when the PC signs out or its sign-in expires or is revoked. Cockpit checks again when sign-in completes, when the session token is renewed and when the app sees the membership change. If the start at launch or a resume cannot start, for example because Tailscale is not connected yet or the port is in use, Remote Access stays paused with server-start-failed; it never switches to standalone on its own. If membership could not be verified at launch, it stays paused with membership-verification-unavailable and also resumes as soon as a verification succeeds. Both pauses try the saved configuration again after 15 seconds, 30 seconds, 1 minute, 2 minutes and 5 minutes, then every 5 minutes, until Remote Access starts or is turned off. When five attempts in a row have failed, a few minutes after the first, the desktop shows one notification with the reason and how to fix it, and Cockpit opens one Ask that only the owner can answer, never a task; clicking the notification opens the Remote Access screen. The Ask offers Reconnect now, which runs the same start as enable once and keeps the 5-minute retries if it fails, and Keep it off, which stops the automatic retries until Cockpit starts next time without changing the saved settings. The Ask closes by itself when Remote Access resumes, is turned off, or pauses for the sign-in or the membership, and an Ask left from an earlier launch is closed at startup. There is at most one such Ask per pause. Keep it off is not undone by sign-in, token renewal, membership checks or reconcile; only an explicit enable, the desktop On option, or the next launch starts Remote Access again. A sign-in or membership pause during that time says so in its notification instead of promising an automatic resume. A sign-in or membership pause does not retry on a timer. Sign-in completion and an explicit reconcile also retry a server-start-failed pause once membership is verified. enable during a pause is still refused with the same membership code. Only disable --confirm and the Off option in the desktop Remote Access screen persist standalone mode and end the pause; after either, signing in does not turn Remote Access back on. Off stays available while Remote Access is paused or starting, including when the screen asks for sign-in, and wins over a resume that is starting at the same time. Clicking the pause notification opens AGI Lab sign-in, or the membership information when the membership is inactive. Start requests that arrive or are still queued while the app quits are dropped.

Every failed start, pause, notification, Keep it off, resume and turn-off is appended to ~/.agi-tools/data/cockpit/logs/remote-access.jsonl with the time, the event and the reason code, so the history stays after Remote Access resumes. A failed start also records failure: tailscale-not-connected, port-in-use, https-certificate or unknown. The log, the notification and the Ask never include the raw error text, tokens or account details.

PWA connections are recorded in ~/.agi-tools/data/cockpit/logs/pwa-connections.jsonl (up to 1 MB, plus two older files .1 and .2). Each line has the time on this PC, source (server or client), event and a random connection ID. The PC records each sign-in result (event: auth, result success or the refusal code, and transport tailscale or local) and each close (event: close) with cause: peer when the browser or the network closed the connection, heartbeat when the browser left three pings in a row unanswered, stop when Remote Access stopped, revoked, or unpaired-timeout, plus the close code, how long it was open and whether it had signed in. The PC pings each connection every 10 seconds, so a browser that stops answering is closed 30 to 40 seconds after its last answer, while a browser that answers late because it is still taking in a large sync stays connected. A heartbeat close also records bufferedBytes, the data the PC still had waiting to send to that browser. After a dropped PWA connects again and its saved connection is accepted, the PWA adds what it saw: the close code, the screen shown (inbox, agents, autorun or detail), whether the page was visible, whether the browser reported being online, the network type the browser reports (wifi, cellular, ethernet, none, other or unknown), the connection attempts and how long the reconnect and the connection check took. The PC accepts these reports only from connections that have signed in, once per connection, up to 20 entries each and 60 reports in 10 minutes, and keeps only these fields. Addresses, URLs, browser names, tokens, task names and message contents are never recorded. Entries the PWA collected while offline are lost if the page closes before it reconnects. While it checks a saved connection again, the PWA keeps the current screen and shows the connecting state; it shows the sign-in screen only when there is no saved connection or the PC refuses it.

status reports runtime.state as running, paused or stopped. While paused it also reports runtime.pausedReason (sign-in-required, authentication-required, membership-required, membership-verification-unavailable or server-start-failed) and runtime.pausedAt (ISO UTC), and configured.mode stays server. After Keep it off it also reports runtime.retryStopped: true until Remote Access starts, is turned off, or Cockpit starts again. runtime.running and runtime.starting keep their meaning.

Cockpit asks Tailscale to print the certificate and private key. It saves only the certificate in Cockpit's own data on this computer, private to the user, for expiry checks while the server is stopped. The private key stays in Cockpit's memory and is never written to disk: Tailscale keeps the original and hands it out again, without asking Let's Encrypt, while the certificate is valid. So the first HTTPS start after each launch of Cockpit asks Tailscale for the certificate before the server listens, using the same membership check as renewal, and every renewal replaces both. A private key copy (.key) or its temporary file that an earlier version of Cockpit left in that folder is removed when Cockpit starts or gets a certificate, and Cockpit checks that none remains. An earlier version of Cockpit finds no key copy and gets the certificate from Tailscale again. macOS, Windows, and Linux use this same retrieval, including App Store, Standalone, and Homebrew Tailscale. Cockpit does not read certificate files stored in another app's folders. Logs, errors, diagnostic exports, and command output never include the private key. If access to an older certificate file was denied, get the certificate again. Full Disk Access is not required.

HTTPS certificates are checked when Remote Access starts and every 24 hours while HTTPS is running. A wake from sleep runs an overdue check. Certificates with 30 days or less remaining, including expired certificates, are renewed through Tailscale and applied to the running TLS server. Existing connections remain open; new TLS connections use the renewed certificate. Automatic renewal uses the same membership verification and single in-flight generation as the manual Renew button and CLI. Tailscale controls reissuance timing; no minimum-validity override is used. Failures retry after six hours. Disabling Remote Access stops scheduled checks.

While HTTPS is running, expiry status and warning thresholds use the certificate successfully loaded by the server, even if a newer certificate is on disk after a failed TLS reload. Stopping the server returns expiry status to the file on disk.

certificate status includes expired (true, false, or null when expiry cannot be read), signed daysRemaining (rounded up, so an expired certificate can have zero days), and renewal:

  • lastAttempt: null before the first automatic renewal, otherwise {time, outcome, error}. time is the ISO UTC attempt start, outcome is success or failure, and error is a non-secret reason code or null on success.
  • nextCheck: ISO UTC scheduled check time, or null while stopped.
  • failed: whether the latest renewal/check needs attention; a failed initial fetch is not a renewal failure. A successful manual renewal or a healthy check with no pending TLS reload clears this without overwriting automatic attempt history.
  • lastNotifiedAt and notification: the persisted warning time and current-session actionable warning, or null. Automatic renewal failures within 14 days of expiry, including expired certificates, show an in-app warning with Renew. Warnings occur at most once per 24 hours, including across restarts. Successful automatic renewals are silent.

Certificate retrieval allows Tailscale up to three minutes. A retrieval timeout returns certificate_generation_timeout from the control API (certificate-generation-timeout in renewal status), with a readable message; it is not reported as a successful HTTP start. Manual and automatic generation failures append a certificate-generation-failed event and a safe reason code to remote-access.jsonl. No command output or key material is recorded.

Reason codes distinguish authentication, membership, temporary membership verification, missing Tailscale login/domain, missing Tailscale HTTPS configuration, certificate generation timeout/check failure, and TLS reload failure. Command output, certificate contents, keys, and personal account details are never included in renewal history.

Ask answers require a verified owner session (cockpit help ask). A valid pairing token is required for HTTP answers as user, including on loopback and same-owner Tailscale peers. Every PWA WebSocket connection requests pairing before sending initial state; an already-paired PWA sends its stored token automatically, and an unpaired PWA must sign in with the same AGI Lab account as the PC before answering. Network ownership alone never grants owner-only Ask access or owner turn authority. A task header never supplies owner identity.

Paired PWA and CLI credentials survive ordinary restarts and Remote Access off/on. The target stores token hashes and connection metadata in its own pairing-credentials.json; each browser retains its token locally. Existing code-issued credentials remain valid. A remote owner CLI obtains a token with cockpit ask pair --host <target> --sign-in and supplies it through AGI_COCKPIT_TASK_REMOTE_TOKEN for answers. See cockpit help ask for sign-in, rate limits and credential handling.

Remote CLI requests (--host) allow 10 seconds to connect and 30 seconds for the complete response. Explicit long waits use their requested timeout plus the existing 15-second transport margin instead of the ordinary response limit. Task and Fleet waits retain their chunked waiting behavior. Talk waits are local-only and retain their existing contract. Crew and project requests use the local Cockpit relay, which retains its 20-second response limit and allows 10 seconds to connect. These are total response deadlines, including reading the body; incoming data does not extend them. Transport failures return host_unreachable (task, Fleet, hooks and Ask requests exit 7; autorun retains exit 1); the other Cockpit may have Remote Access off or may not be running. HTTP errors retain their original response and code. Requests without --host retain their existing transport and timeout behavior.