DEV Community

zu
zu

Posted on

Open Source - Let Local Codex Temporarily Operate a Remote Linux Server

Agent RemoteOps

Give Codex temporary access to a remote Linux host for diagnostics and maintenance, with scoped permissions, automatic expiration, and a complete audit trail.

Open-source project

The problem it solves

Powerful coding agents such as Claude Code and Codex have become part of many developers’ daily workflows. But these agents usually run on a local machine. When it is time to deploy a release, investigate a production incident, or perform one-off maintenance on a Linux server, getting the local agent involved is often surprisingly difficult.

Private networks, closed ports, host firewalls, and inbound or outbound security-group rules can make both common approaches inconvenient: installing a full agent on the server, or connecting the local agent over SSH.

I built Agent RemoteOps to remove that friction. The project has two parts: the agent-remoteops npm package, which runs on the remote host, and an Agent RemoteOps Skill installed in local Codex. As long as the server can reach the internet, it can create a temporary public endpoint without changing the existing network or firewall configuration. Codex then uses the Skill to connect to that session and carry out focused operational work.

Agent RemoteOps starts a temporary HTTP service bound only to 127.0.0.1 on the remote Linux host. A Cloudflare Quick Tunnel exposes that local service through a short-lived public URL. You give Codex the URL, session token, and task; Codex can then read files or run commands within the permissions granted to that session. When the session expires—or when you press Ctrl+C—the HTTP service, tunnel, active jobs, and tracked child processes are shut down.

Local Codex
└─ Agent RemoteOps Skill
   └─ Bundled Python client
      │ HTTPS + session token
      ▼
Cloudflare Quick Tunnel
      ▼
Remote Linux host
└─ agent-remoteops CLI
   ├─ File API
   ├─ Command jobs
   └─ Permissions, TTL, audit logs, and process cleanup
Enter fullscreen mode Exit fullscreen mode

Demo

1. Start a temporary session on the remote Linux server

Run the CLI in the directory you want Codex to work from, then choose the session language, lifetime, permission mode, workspace, and audit settings.

2. Give Codex the session details and the task

Send Codex the temporary URL, token, and a precise task. The Skill submits the token securely, verifies the effective server-side permissions, and then performs the requested work.

3. Monitor the live audit log

The remote console shows connections, authentication events, API requests, and command-job activity in real time, making it easy to follow progress and review what the agent actually did.

Installation

Remote Linux: install the CLI

npm install -g agent-remoteops
Enter fullscreen mode Exit fullscreen mode

The CLI starts and manages remote sessions:

Command Purpose
agent-remoteops start Interactively create a temporary session
agent-remoteops policy show readonly Show a summary of the readonly policy
agent-remoteops policy show full Show a summary of the full policy

Local Codex: install the Skill

Send the following message to Codex:

Install the Agent RemoteOps Skill from this GitHub directory:

https://github.com/wwenj/AgentRemoteOps/tree/master/skills/agent-remoteops
Enter fullscreen mode Exit fullscreen mode

Quick start

  1. On the remote Linux host, enter the directory you want to use as the initial workspace and start a session:
   cd /srv/app
   agent-remoteops start
Enter fullscreen mode Exit fullscreen mode
  1. In the interactive CLI, choose the language, session lifetime, permission mode, working directory, and audit-log settings. Review the summary and confirm the session.
  2. Once the session is ready, send the displayed URL, token, and a specific task to a Codex installation that has the Skill.
  3. The Skill submits the token, checks the server’s effective permissions, and carries out the task automatically.
  4. Each CLI session accepts only one connected client, reducing the risk of an unexpected second connection.
  5. When the work is complete, press Ctrl+C in the remote terminal, or let the session expire automatically.
  6. Execution logs remain on the remote host for later review.

Original-content notice

This is an original article. If you republish it, please credit the author and link to the original. The illustrations were generated with AI. Follow my public account for more articles.

AI assistance and editorial transparency

Top comments (0)