ssh
БесплатноБез исполняемых скриптовНе проверенOpenSSH gives encrypted remote login, file transfer and port forwarding between machines. Use when a user asks to connect to a remote server, generate or…
от TerminalSkills★ 221 звезда на GitHubОб этом скилле
SSH
Overview
SSH (Secure Shell, implemented by OpenSSH) provides encrypted remote shells, command execution, file copy (scp, sftp) and port forwarding. Current OpenSSH is 10.5 (August 2026). Things that changed recently and matter in practice:
- OpenSSH 10.0 removed DSA keys entirely and made the post-quantum hybrid key exchange
mlkem768x25519-sha256the default. - 10.1 added a warning when a connection negotiates a non-post-quantum key exchange (option
WarnWeakCrypto, on by default). The warning means the server is old; upgrade the server rather than silencing it. scpandsftpnow passControlMaster noto ssh, so they no longer open implicit shared sessions.- sshd's
PasswordAuthenticationand similar settings can be overridden by files in/etc/ssh/sshd_config.d/; see Guidelines.
Instructions
Step 1: Keys
ssh-keygen -t ed25519 -a 100 -C "ci-deploy-key" # -a raises the KDF rounds protecting the passphrase
ssh-copy-id -i ~/.ssh/id_ed25519.pub [email protected]
ssh-add ~/.ssh/id_ed25519 # cache the unlocked key in ssh-agent
ssh-keygen -lf ~/.ssh/id_ed25519.pub # show the fingerprint
Ed25519 is the default recommendation; use RSA 3072+ only for old systems. Keep private keys at mode 600 and ~/.ssh at 700; sshd ignores keys with loose permissions. Always set a passphrase on keys that live on laptops. On macOS, AddKeysToAgent yes plus UseKeychain yes in config avoids retyping it.
Step 2: Client config (~/.ssh/config)
Host *
ServerAliveInterval 30
AddKeysToAgent yes
IdentitiesOnly yes
Host bastion
HostName bastion.acme-labs.io
User admin
IdentityFile ~/.ssh/id_ed25519
Host prod
HostName 203.0.113.10
User deploy
Port 2222
ProxyJump bastion
ControlMaster auto
ControlPath ~/.ssh/cm-%C
ControlPersist 10m
Host dev-*
HostName %h.internal.acme-labs.io
User developer
ProxyJump bastion
ssh prod reaches the host through the bastion and reuses one connection for 10 minutes; ssh dev-api connects to dev-api.internal.acme-labs.io. Check what a name resolves to with ssh -G prod. The first matching value for each option wins, so put specific Host blocks before Host *. Ad hoc jump: ssh -J [email protected] [email protected].
Step 3: Tunnels
ssh -N -L 5432:db.internal:5432 bastion # local port 5432 -> db.internal:5432 as seen from bastion
ssh -N -R 8080:localhost:3000 prod # remote port 8080 -> your local port 3000
ssh -N -D 1080 prod # SOCKS5 proxy on localhost:1080
ssh -f -N -L 8443:10.0.4.20:443 bastion # -f: go to background after authentication
Forwards listen on the loopback interface only. A remote forward is reachable from other machines only if the server sets GatewayPorts, which is usually unwanted. Stop a background tunnel by its PID, or with ssh -O exit prod when ControlMaster is in use.
Step 4: Server hardening (/etc/ssh/sshd_config.d/10-hardening.conf)
PermitRootLogin no
PasswordAuthentication no
KbdInteractiveAuthentication no
PubkeyAuthentication yes
MaxAuthTries 3
AllowUsers deploy admin
ClientAliveInterval 300
ClientAliveCountMax 2
Validate before reloading, and keep an existing session open while testing from a second one:
sudo sshd -t && sudo sshd -T | grep -iE "passwordauthentication|permitrootlogin"
sudo systemctl reload ssh # the unit is "sshd" on RHEL-family systems
Examples
Example 1: Reach a private database through a bastion
Request: "I need to run psql against the staging database that is only reachable from the bastion."
ssh -f -N -L 15432:db.staging.internal:5432 bastion
psql "host=127.0.0.1 port=15432 dbname=orders user=report"
Result: psql connects to localhost:15432 and the traffic goes over SSH to db.staging.internal:5432. Using local port 15432 avoids clashing with a local PostgreSQL on 5432. Close the tunnel by stopping the ssh process you started (find its PID with pgrep -u "$USER" -fa "ssh -f -N -L 15432").
Example 2: Lock down a new server without locking yourself out
Request: "Disable password logins on my VPS."
ssh-copy-id -i ~/.ssh/id_ed25519.pub [email protected] # 1. install your key first
ssh [email protected] 'sudo tee /etc/ssh/sshd_config.d/10-hardening.conf' <<'EOF'
PasswordAuthentication no
PermitRootLogin no
EOF
ssh [email protected] 'sudo sshd -t && sudo sshd -T | grep -i passwordauthentication'
Result: sshd -T prints passwordauthentication no when the setting is effective. If it still says yes, another file in /etc/ssh/sshd_config.d/ (cloud-init often ships 50-cloud-init.conf) set it first; sshd uses the first value it reads, and files load in alphabetical order. Reload sshd, then open a new session to confirm the key works before closing the old one.
Example 3: Fix "REMOTE HOST IDENTIFIC
Установить ssh в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл ssh?
OpenSSH gives encrypted remote login, file transfer and port forwarding between machines. Use when a user asks to connect to a remote server, generate or install SSH keys, write ~/.ssh/config, reach hosts through a bastion with ProxyJump, create local, remote or SOCKS tunnels, harden sshd, or fix permission denied and host key errors.
Как установить скилл ssh?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл ssh запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic