Connect to Remote Servers via SSH
Connect Claude Code to a remote server over SSH to run commands, tail logs, and manage Docker Compose services without leaving the session.
guardian-v1.0.0Add to Favorites
Why it matters
Establish secure SSH connections to remote servers, enabling agent forwarding for enhanced security and access control.
Outcomes
What it gets done
Initiate SSH connections to specified remote servers.
Configure and utilize agent forwarding for secure authentication.
Manage access to remote server environments.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/ssh-remote-connection | bash Overview
SSH Remote Connection
Connects Claude Code to a remote server over SSH so it can run an interactive shell or a single command directly. Typical uses include tailing Docker Compose logs, checking container status, or restarting and rebuilding a backend service. Use it when you need Claude Code to inspect or operate a remote Docker Compose deployment - reading logs, checking status, or restarting a service. Do not use it for git syncing; code must be pushed and pulled by the user manually, never via git pull on the server.
What it does
The SSH Remote Connection skill gives Claude Code a direct line into a remote server over SSH, through two entry points: an interactive shell and a direct command runner. Running scripts/connect.sh opens an interactive session on the remote host, while passing a command as an argument executes it directly and returns the output, for example scripts/connect.sh "docker compose logs backend --tail 50". This turns remote server inspection and light operations into a single scripted call instead of a separate manual SSH session.
When to use - and when NOT to
Use this skill whenever a task requires touching a remote server directly: tailing application logs, checking the status of running containers, or restarting or rebuilding a Docker Compose service. Do NOT use it for git synchronization. The skill explicitly forbids running git pull on the server - code lives in a private repository, and the intended flow is for Claude to push changes locally and let the user pull them on the server manually. Treat it purely as an execution and inspection tool for an already-deployed stack, not as a deploy or sync mechanism.
Inputs and outputs
Local setup means copying the config template and making the connect script executable:
cp config/.env.example config/.env
chmod +x scripts/connect.sh
The filled-in config/.env (or, for cloud runtimes, equivalent environment variables) supplies the connection inputs: SSH_HOST for the server hostname or IP, SSH_USER for the login user, SSH_KEY_PATH for the private key, an optional SSH_KEY_PASSWORD for the key passphrase, and SERVER_PROJECT_PATH for the project directory on the server. Output is whatever the remote command produces - log lines, container status, or the result of a restart/rebuild - streamed straight back into the Claude Code session.
Integrations
The skill is built around a Docker Compose-based server deployment and is explicit that commands should use docker compose (the modern CLI plugin syntax) rather than the older standalone docker-compose binary. Common commands shown include viewing recent logs, restarting a single service, rebuilding and restarting it, and checking overall container status:
scripts/connect.sh "docker compose restart backend"
scripts/connect.sh "docker compose build backend && docker compose up -d backend"
scripts/connect.sh "docker compose ps"
Beyond Docker Compose, the skill has no other platform dependency - it works over plain SSH with a private key, so it fits any server reachable that way.
Who it's for
Developers and agents responsible for a backend service running under Docker Compose on a remote host, who need Claude Code to check on it, read its logs, or restart/rebuild it as part of a working session - without handing it a full deployment or git-sync workflow.
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.