Agentic SSH access and remote server operations via alogin...
Use this skill when the task involves remote server access, health inspection, persistent shell sessions, cluster execution, file transfer, or tunnel management.
Common triggers: SSH, remote shell, server login, bastion, health check,
inspect node, run command, persistent session, cluster, SFTP, background job,
server memory, alogin.
MCP vs CLI priority
If MCP tools are available in your environment, always prefer them over the alogin CLI — they carry richer audit metadata, handle reconnection automatically, and keep the session state server-side.
Task MCP (preferred) CLI (fallback) Persistent shell remote_shellalogin ssh session execOne-shot command exec_commandalogin ssh connect --cmdHealth snapshot inspect_nodealogin ssh connect --cmd "..."Upload + run script run_scriptalogin ssh run-scriptEdit remote file remote_replacealogin ssh session exec sedFile transfer push_file/pull_filealogin scp push/pullCluster exec exec_on_clusteralogin ssh cluster <name> --cmdList servers list_serversalogin server list --format jsonTunnel manage start_tunnel/stop_tunnelalogin net tunnel start/stopServer memory get_memory/save_memoryalogin agent server-memory list/add
1. DISCOVER — list_servers / alogin server list --format json
2. RECALL — get_memory(server_id) before any work on a known server
3. SHELL — remote_shell(target) → session_id, then reuse for every command
4. INSPECT — inspect_node before making changes
5. ACT — remote_shell for sequences; exec_command only for one-shot
6. VERIFY — read-only check after change
7. SAVE — save_memory() with findings before closing session
8. CLEANUP — remote_shell(target, session_id, command="exit")
Always supply an intent parameter on execution tools — it is written to the
audit log and is the primary signal for HITL reviewers.
list_serversList servers in the registry.
| Parameter | Type | Required | Description |
|---|---|---|---|
query |
string | no | Filter by host, user, or note |
Returns: [{id, host, user, protocol, device_type, note, gateway_id}]
get_serverFull detail for one server.
| Parameter | Type | Required |
|---|---|---|
id |
string/number | yes |
list_clusters / get_clusterList cluster groups or get one with full member detail.
| Parameter | Type | Required |
|---|---|---|
id (get_cluster) |
string/number | yes |
inspect_nodeStructured health snapshot: CPU load, memory, disk, top processes.
| Parameter | Type | Required | Description |
|---|---|---|---|
server_id |
string/number | yes | |
timeout_sec |
number | no | default 30 |
agent_id |
string | no | logged |
intent |
string | no | logged |
list_tunnels / get_tunnelList saved tunnels with live running status, or get one by ID.
get_memoryRetrieve operational notes written by previous agents for this server. Call immediately after identifying the target server.
| Parameter | Type | Required |
|---|---|---|
server_id |
string/number | yes |
Returns: [{id, server_id, content, created_at}]
save_memoryRecord lasting operational knowledge (PATH quirks, version constraints, service layout). Write entries that will be useful three sessions from now.
| Parameter | Type | Required | Description |
|---|---|---|---|
server_id |
string/number | yes | |
content |
string | yes | Free-form operational note |
remote_shell ⭐ Primary toolPersistent SSH session identified by session_id. Shell state (cwd, env vars)
carries across calls. Reconnects automatically on TCP drop.
| Parameter | Type | Required | Description |
|---|---|---|---|
target |
string/number | yes | Server ID |
command |
string | no | Omit to open session; "exit" to close |
session_id |
string | no | Omit to create new session |
pty |
boolean | no | Allocate PTY for TUI programs (top, vi, htop) |
login_shell |
boolean | no | Source ~/.bash_profile (default true) |
timeout_sec |
number | no | Per-command wall-clock limit (default 120) |
agent_id |
string | no | logged |
intent |
string | no | logged |
// Open session
{"tool": "remote_shell", "arguments": {"target": "3", "intent": "deploy app"}}
// → {"session_id": "abc-123", "status": "created"}
// Reuse session
{"tool": "remote_shell", "arguments": {"target": "3", "session_id": "abc-123", "command": "df -h"}}
// Close session
{"tool": "remote_shell", "arguments": {"target": "3", "session_id": "abc-123", "command": "exit"}}
exec_commandOne-shot SSH command. Use only when no follow-up commands are expected.
| Parameter | Type | Required | Description |
|---|---|---|---|
server_id |
string/number | yes | |
commands |
string[] | yes | |
expect |
object[] | no | PTY mode: [{"pattern": "...", "send": "..."}] |
timeout_sec |
number | no | default 30 |
agent_id |
string | no | logged |
intent |
string | no | logged |
exec_on_clusterRun commands on all cluster members in parallel.
| Parameter | Type | Required |
|---|---|---|
cluster_id |
string/number | yes |
commands |
string[] | yes |
timeout_sec |
number | no |
agent_id |
string | no |
intent |
string | no |
run_scriptUpload a script string to the remote host, execute it, then delete the temp file.
Preferred over push_file + remote_shell for multi-line scripts.
| Parameter | Type | Required | Description |
|---|---|---|---|
server_id |
string/number | yes | |
content |
string | yes | Script source |
interpreter |
string | no | default bash |
login_shell |
boolean | no | default false |
timeout_sec |
number | no | default 120 |
agent_id |
string | no | logged |
intent |
string | no | logged |
remote_replaceSafe in-place string substitution in a remote file.
Prefer over cat + run_script when editing config files.
| Parameter | Type | Required | Description |
|---|---|---|---|
server_id |
string/number | yes | |
path |
string | yes | Absolute path |
old_string |
string | yes | Exact literal (case-sensitive) |
new_string |
string | yes | Replacement (empty = delete) |
all |
boolean | no | Replace all occurrences (default true) |
agent_id |
string | no | logged |
intent |
string | no | logged |
Returns: {"replaced": N} — 0 means not found, file unchanged.
start_tunnel / stop_tunnelStart or stop a saved tunnel (tmux-backed).
| Parameter | Type | Required |
|---|---|---|
id |
string/number | yes |
Always call list_tunnels first to avoid starting duplicates.
Use the following when MCP tools are not available.
alogin server list --format json
alogin server show <host> --format json
alogin server add --host 10.0.0.10 --user admin
alogin server add --host bastion --user ops --auth-method key --identity-file ~/.ssh/id_ed25519
alogin server alias add prod admin@prod-db
alogin server alias list --format json
# Start session (prints session ID)
id=$(alogin ssh session start web-01)
# Commands share state — cd, exports persist
alogin ssh session exec "$id" "cd /var/log && ls"
alogin ssh session exec --timeout 300 "$id" "make build"
alogin ssh session exec --force-utf8 "$id" "cat /etc/os-release"
# List and reuse
alogin ssh session list
alogin ssh session exec "$existing_id" "uptime"
# Stop when done
alogin ssh session stop "$id"
--timeout N = wall-clock limit (default 30 s).
--idle-timeout N = cut if silent for N seconds.
--force-utf8 = fix garbled multi-byte output (Korean, Japanese, etc.).
alogin ssh connect web-01 --cmd "df -h"
alogin ssh connect user@host --cmd "hostname" --force-utf8
Use only for truly independent, stateless single commands.
id=$(alogin ssh session start web-01)
job=$(alogin ssh session bg-exec "$id" "apt-get upgrade -y")
alogin ssh session job status "$job"
alogin ssh session job logs --follow "$job"
alogin ssh session job list --session "$id" --json
alogin ssh session job cancel "$job"
alogin ssh session job purge
alogin ssh cluster add web-cluster 10.0.1.1 10.0.1.2
alogin ssh cluster list --format json
alogin ssh cluster web-cluster --cmd "uptime"
alogin ssh cluster web-cluster --cmd "df -h" --format json
alogin scp push ./deploy.tar.gz web-01:/opt/releases/
alogin scp pull web-01:/var/log/app.log ./
alogin scp push --recursive ./dist/ web-01:/var/www/app/
alogin scp pull -r web-01:/var/log/nginx/ ./logs/
# Local file
alogin ssh run-local ./deploy.sh --remote web-01
alogin ssh run-local ./check.py --remote web-01 --interpreter python3
alogin ssh run-local ./setup.sh --remote web-01 -- --env prod
# Inline / piped content
echo "df -h && uptime" | alogin ssh run-script --remote web-01
alogin ssh run-script --remote web-01 --content "#!/bin/bash\ndf -h\nuptime"
alogin net gateway add secure-zone bastion.ext.com internal-jump
alogin net gateway list --format json
alogin server add --host prod-sql --gateway secure-zone
alogin net profile add office --gateway secure-zone
alogin net profile use office
alogin net profile use none
alogin net tunnel add db-proxy --server prod-db --local-port 5432 --remote-port 5432
alogin net tunnel start db-proxy
alogin net tunnel status db-proxy
alogin net tunnel stop db-proxy
alogin agent server-memory list <server-id>
alogin agent server-memory add <server-id> --text "nginx config: /etc/nginx/nginx.conf"
alogin agent server-memory del <server-id> <note-id>
alogin server show <id> --format json # includes system_prompt field
The system_prompt field contains server-specific restrictions.
Read it before connecting and adhere to it throughout the session.
intent on execution tool calls.rm -rf, shutdown, DROP TABLE) without
explicit user confirmation — HITL policy will block or queue them.device_type is router, switch, or firewall, do not assume
standard Linux commands work.list_tunnels before starting a tunnel to avoid duplicates.remote_replace over full-file rewrites.Three patterns to apply every session:
Dynamic profiling — After exploring a new server, call save_memory with
log paths, installed tools, service layout. Next session starts with full
context, zero exploration turns.
State drift detection — Save baselines (disk %, process counts, config checksums). On subsequent sessions, compare and flag anomalies proactively.
Multi-agent handoff — Notes written by one agent are immediately available to the next. No duplicate work; no knowledge lost between agents.
alogin server list --format json | jq '.[].host'
alogin ssh cluster prod --cmd "uptime" --format json | jq '.[] | {host, output}'
alogin net tunnel list --format json
alogin ssh session job list --json