ssh

ssh is a skill for Claude Code, Codex from chaterm/terminal-skills. It costs 7 tokens per session (1,577 once invoked), scanned F, original, Apache-2.0.

A guide to using SSH, a secure way to connect to and run commands on another computer. It covers connections, configuration files, login keys, jump hosts, port forwarding, and basic security settings.

In plain words
What is it for?
Connecting to remote servers, running commands there, creating and managing SSH keys, copying public keys, and configuring reusable server aliases.
Why use it?
It helps avoid repeatedly typing long connection commands and provides guidance for setting up key-based access and troubleshooting failed connections.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/chaterm/terminal-skills/ssh
Any agent
npx skills add chaterm/terminal-skills --skill ssh
Clone the repo
git clone --depth 1 https://github.com/chaterm/terminal-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ssh

README.md
[![agentmods](https://agentmods.dev/badge/skills/chaterm/terminal-skills/ssh.svg)](https://agentmods.dev/skills/chaterm/terminal-skills/ssh)
Your own site
<a href="https://agentmods.dev/skills/chaterm/terminal-skills/ssh"><img src="https://agentmods.dev/badge/skills/chaterm/terminal-skills/ssh.svg" alt="Measured on agentmods" height="20"></a>
Per session 7 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,577 The whole file, excluding the scripts and references it only reads on demand.
Security scan F 4 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00007 $0.01577
Opus 5 $0.00003 $0.00788
Sonnet 5 $0.00001 $0.00315
Haiku 4.5 $0.00001 $0.00158

Measured 6d ago against content hash 148474afe32a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade F, and why

ssh scanned grade F with 4 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Enumerates the file system for secretshighData exfiltration

Searching home directories for .env, .ssh, .aws or credential files is reconnaissance for credential theft.

ls -la ~/.ssh/

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

chmod 700 ~/.ssh

Reaches for credential fileshighPrivilege escalation

SSH keys, cloud credentials, git-credentials, .npmrc, /etc/shadow: reading these is how a config file becomes a credential leak.

IdentityFile ~/.ssh/id_rsa_myserver

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl http://localhost:8080
server/ssh/SKILL.md · 270 lines

How it starts

The opening of the file, as written. The whole thing — 270 lines — stays where its author put it; the contents beside it link to each section on GitHub.

SSH 管理与安全

概述

SSH 密钥管理、跳板机配置、端口转发、安全加固等技能。

基础连接

连接命令

# 基础连接
ssh user@hostname
ssh -p 2222 user@hostname           # 指定端口

# 执行远程命令
ssh user@hostname "command"
ssh user@hostname 'ls -la && df -h'

# 详细输出(调试)
ssh -v user@hostname
ssh -vvv user@hostname              # 更详细

配置文件

# ~/.ssh/config
Host myserver
    HostName 192.168.1.100
    User admin
    Port 22
    IdentityFile ~/.ssh/id_rsa_myserver

Host dev-*
    User developer
    IdentityFile ~/.ssh/id_rsa_dev

Host *
    ServerAliveInterval 60
    ServerAliveCountMax 3
    AddKeysToAgent yes

# 使用配置
ssh myserver

密钥管理

生成密钥

# 生成 RSA 密钥(推荐 4096 位)
ssh-keygen -t rsa -b 4096 -C "[email protected]"

# 生成 Ed25519 密钥(推荐)
ssh-keygen -t ed25519 -C "[email protected]"

# 指定文件名
ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519_work

# 修改密码
ssh-keygen -p -f ~/.ssh/id_rsa

部署公钥

# 方式1:ssh-copy-id
ssh-copy-id user@hostname
ssh-copy-id -i ~/.ssh/id_ed25519.pub user@hostname

# 方式2:手动复制
cat ~/.ssh/id_ed25519.pub | ssh user@hostname "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"

# 方式3:直接编辑
ssh user@hostname
echo "public_key_content" >> ~/.ssh/authorized_keys
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys

SSH Agent

# 启动 agent
eval "$(ssh-agent -s)"

# 添加密钥
ssh-add ~/.ssh/id_rsa
ssh-add -l                          # 列出已添加的密钥

# 转发 agent(跳板机场景)
ssh -A user@jumphost

端口转发

本地转发

# 将本地端口转发到远程
ssh -L local_port:target_host:target_port user@ssh_server

# 示例:访问远程 MySQL
ssh -L 3306:localhost:3306 user@dbserver
mysql -h 127.0.0.1 -P 3306

# 示例:访问内网服务
ssh -L 8080:internal.server:80 user@jumphost
curl http://localhost:8080

远程转发

# 将远程端口转发到本地
ssh -R remote_port:local_host:local_port user@ssh_server

# 示例:暴露本地服务
ssh -R 8080:localhost:3000 user@public_server
# 现在可以通过 public_server:8080 访问本地 3000 端口

动态转发(SOCKS 代理)

# 创建 SOCKS5 代理
ssh -D 1080 user@ssh_server

# 使用代理
curl --socks5 localhost:1080 http://example.com

Read the full file on GitHub · 270 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 270 lines · 7 tokens per session scan F 148474afe32a

Subscribe to this mod's changes

ssh is a skill published in the GitHub repository chaterm/terminal-skills (58 stars, last pushed 6mo ago), licensed Apache-2.0. It adds 7 tokens to every session and 1,577 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it F with 4 findings (enumerates the file system for secrets, asks for root, reaches for credential files). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.