ssh-essentials
Skill0 starsChanged 3 months agoMITView on GitHub
Secure server management with SSH keys, hardening, and jump hosts
- Reads credentials
- Installs packages
1 other project uses a version of this.
Adopted by
Most recently taken up by
- xiangu152/my_claude_skillstheir own version, first seen Apr 5, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- xiangu152/my_claude_skills★ 2same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository27 other files it gives its agents.
- architecture-designerSkill
- architecture-patternsSkill
- code-reviewSkill
- dockerSkill
- fastapiSkill
- feature-specificationSkill
- github-issue-resolverSkill
- github-opsSkill
- kubernetes-devopsSkill
- monitoringSkill
- nextjsSkill
- nginxSkill
- prd-to-ddd-designSkill
- prd-writerSkill
- prismaSkill
- react-expertSkill
- redisSkill
- redis-storeSkill
- requirements-analysisSkill
- shadcn-uiSkill
- task-decomposerSkill
- task-development-workflowSkill
- trpc-best-practicesSkill
- typescript-proSkill
- typescriptSkill
- webhookSkill
- zodSkill
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 8 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 25
Use this skill when you need to:
- Distinctive: line 57
Do you need password or key authentication?
- Distinctive: line 59
Do you need jump host access?
- Distinctive: line 84
Use one key per identity (work, personal, projects)
- Distinctive: line 85
Don't create unnecessary keys
- Distinctive: line 86
Use passphrases for keys on shared machines
- Distinctive: line 186
Only modify what's needed
- Distinctive: line 188
Test after each change
- Very specific: line 401
Use ssh-keygen (sets permissions correctly)
- Very specific: line 402
Use ssh-copy-id (sets server permissions)
- Very specific: line 403
Never use chmod 777 on SSH files
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
SSH Essentials
Purpose: Secure server management using SSH with key authentication, hardening, and jump hosts.
Works with: OpenSSH 8.0+
License: MIT (original work, inspired by OpenSSH docs, Mozilla SSH guidelines, NIST standards)
When to Use
Use this skill when you need to:
- Configure SSH key authentication
- Harden SSH server configuration
- Set up jump hosts (bastion servers)
- Manage multiple SSH identities
- Troubleshoot SSH connection issues
Don't use this for:
- Interactive terminal sessions (use tmux/screen instead)
- File transfers (consider rsync, scp, or sftp)
- Complex automation (consider Ansible, Terraform)
Prerequisites
1. Install OpenSSH
# macOS (pre-installed)
ssh -V
# Linux (Debian/Ubuntu)
sudo apt update && sudo apt install openssh-client openssh-server
# Verify version (8.0+)
ssh -V # Should show OpenSSH_8.0 or higher2. Basic Understanding
Think Before Coding (Karpathy Principle #1):
- Do you need password or key authentication?
- Is the server publicly accessible or behind firewall?
- Do you need jump host access?
- What security level is required?
Core Workflows
1. SSH Key Management
Generate SSH Keys
Best Practice: Ed25519 for new keys, RSA 4096 for legacy systems
# Modern (Ed25519 - recommended)
ssh-keygen -t ed25519 -C "your-email@example.com"
# Legacy (RSA 4096)
ssh-keygen -t rsa -b 4096 -C "your-email@example.com"
# With custom name and passphrase
ssh-keygen -t ed25519 -f ~/.ssh/id_work -C "work@company.com"Simplicity First (Karpathy Principle #2):
- Use one key per identity (work, personal, projects)
- Don't create unnecessary keys
- Use passphrases for keys on shared machines
File Permissions (critical):
chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_ed25519
chmod 644 ~/.ssh/id_ed25519.pub
chmod 600 ~/.ssh/config
chmod 600 ~/.ssh/authorized_keysSuccess Criteria:
- Private key permissions: 600
- Public key permissions: 644
- ~/.ssh directory: 700
- Passphrase set (for sensitive keys)
Distribute Public Keys
Method 1: ssh-copy-id (easiest):
# Copy default key
ssh-copy-id user@server
# Copy specific key
ssh-copy-id -i ~/.ssh/id_work.pub user@serverMethod 2: Manual:
# On local machine
cat ~/.ssh/id_ed25519.pub
# On server
mkdir -p ~/.ssh
echo "ssh-ed25519 AAAA... your-email@example.com" >> ~/.ssh/authorized_keys
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keysSuccess Criteria:
- Public key in ~/.ssh/authorized_keys on server
- Can login without password:
ssh user@server - No password prompt appears
2. SSH Configuration
Client Config (~/.ssh/config)
# Global defaults
Host *
AddKeysToAgent yes
IdentityFile ~/.ssh/id_ed25519
ServerAliveInterval 60
ServerAliveCountMax 3
StrictHostKeyChecking ask
ForwardAgent no # Security: don't forward by default
# macOS-specific: Store passphrases in Keychain
# WARNING: UseKeychain is macOS-only and will cause errors on Linux/Windows
# Uncomment only if you're on macOS:
# Match host * exec "test $(uname) = Darwin"
# UseKeychain yes
# Specific server
Host myserver
HostName 192.168.1.100
User admin
Port 2222
IdentityFile ~/.ssh/id_work
# With jump host
Host internal-server
HostName 10.0.1.50
User ubuntu
ProxyJump bastion
Host bastion
HostName jump.company.com
User jumpuser
Port 22Benefits:
- Shorter commands:
ssh myserverinstead ofssh -i ~/.ssh/id_work -p 2222 admin@192.168.1.100 - Consistent configuration
- Easy multi-hop access
3. SSH Server Hardening
Server Config (/etc/ssh/sshd_config)
Surgical Changes (Karpathy Principle #3):
- Only modify what's needed
- Comment original values
- Test after each change
# Essential hardening
Port 2222 # Change from default 22
PermitRootLogin no
PasswordAuthentication no
PubkeyAuthentication yes
KbdInteractiveAuthentication no # Replaces deprecated ChallengeResponseAuthentication
UsePAM yes
# Allow specific users only
AllowUsers alice bob admin
# Or allow specific groups
AllowGroups sshusers
# Limit authentication attempts
MaxAuthTries 3
# Session timeout (5 minutes idle)
ClientAliveInterval 300
ClientAliveCountMax 0
# Disable forwarding (if not needed)
AllowTcpForwarding no
X11Forwarding no
AllowAgentForwarding no
# Modern ciphers only
Ciphers aes256-gcm@openssh.com,aes128-gcm@openssh.com
MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com
KexAlgorithms curve25519-sha256,curve25519-sha256@libssh.orgApply changes:
# Test configuration
sudo sshd -t
# Restart service
sudo systemctl restart sshd
# Check status
sudo systemctl status sshdSuccess Criteria:
- Root login disabled
- Password authentication disabled
- Only key authentication works
- Port changed from default
- Can still access server
4. Jump Hosts (Bastion Servers)
Setup ProxyJump
Use case: Access internal servers via bastion/jump host
Config:
# ~/.ssh/config
Host bastion
HostName jump.company.com
User jumpuser
Port 22
IdentityFile ~/.ssh/id_jump
Host internal-*
ProxyJump bastion
User admin
IdentityFile ~/.ssh/id_internal
Host internal-web
HostName 10.0.1.10
Host internal-db
HostName 10.0.1.20Usage:
# Direct access (automatic jump)
ssh internal-web
# Equivalent manual command
ssh -J jumpuser@jump.company.com:22 admin@10.0.1.10
# Multi-hop (bastion1 → bastion2 → target)
ssh -J bastion1,bastion2 targetGoal-Driven Execution (Karpathy Principle #4):
- Can reach bastion →
ssh bastion - Can reach internal →
ssh internal-web - Port forwarding works (if needed)
Common Patterns
Pattern 1: Multiple Identities
Scenario: Work, personal, client projects
# ~/.ssh/config
Host github-work
HostName github.com
User git
IdentityFile ~/.ssh/id_work
Host github-personal
HostName github.com
User git
IdentityFile ~/.ssh/id_personal
Host *.work.com
User admin
IdentityFile ~/.ssh/id_work
Host *.client.com
User deploy
IdentityFile ~/.ssh/id_clientUsage:
# Work GitHub
git clone github-work:company/repo.git
# Personal GitHub
git clone github-personal:username/repo.gitPattern 2: Port Forwarding
Local forward (access remote service locally):
# Forward remote database to local port 5432
ssh -L 5432:localhost:5432 dbserver
# Now connect locally
psql -h localhost -p 5432Remote forward (expose local service to remote):
# Make local port 3000 available on remote port 8080
ssh -R 8080:localhost:3000 serverDynamic forward (SOCKS proxy):
# Create SOCKS proxy on port 1080
ssh -D 1080 server
# Configure browser to use localhost:1080 as SOCKS5 proxyPattern 3: File Operations
# Copy file to server
scp local-file.txt user@server:/remote/path/
# Copy directory recursively
scp -r local-dir/ user@server:/remote/path/
# Copy via jump host
scp -J bastion local-file.txt user@internal:/path/
# Sync directories (better than scp)
rsync -avz --progress local-dir/ user@server:/remote/dir/
# Exclude patterns
rsync -avz --exclude '*.log' --exclude 'node_modules/' src/ server:/app/Common Pitfalls
Pitfall 1: Wrong Permissions
Why it happens: SSH is very strict about file permissions
Symptoms:
Permission denied (publickey)How to fix:
# On local machine
chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_*
chmod 644 ~/.ssh/id_*.pub
chmod 600 ~/.ssh/config
# On server
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keysHow to avoid:
- Use
ssh-keygen(sets permissions correctly) - Use
ssh-copy-id(sets server permissions) - Never use
chmod 777on SSH files
Pitfall 2: Key Not Being Used
Why it happens: SSH doesn't know which key to use
Symptoms:
debug1: Offering public key: /Users/you/.ssh/id_rsa
debug1: Server accepts key(But still asks for password)
How to fix:
# Test which key is being offered
ssh -v user@server 2>&1 | grep "Offering public key"
# Specify key explicitly
ssh -i ~/.ssh/id_correct user@server
# Add to config
Host server
IdentityFile ~/.ssh/id_correct
IdentitiesOnly yesPitfall 3: Connection Timeout
Why it happens: Firewall, wrong port, server down
Symptoms:
ssh: connect to host X.X.X.X port 22: Operation timed outHow to debug:
# Test connectivity
ping server-ip
# Test port (if telnet available)
telnet server-ip 22
# Or use netcat
nc -zv server-ip 22
# Check SSH with verbose
ssh -vvv user@serverCommon causes:
- Firewall blocking port 22 (or custom port)
- Server sshd not running
- Wrong IP or hostname
- Network routing issue
Verification Checklist
Key Setup:
- Keys generated with proper algorithm (Ed25519 or RSA 4096)
- Private key permissions: 600
- Public key distributed to server
- Can login without password
Server Hardening:
- Root login disabled
- Password authentication disabled
- Port changed from default 22
- Only specific users can login
- Connection limits configured
Configuration:
- ~/.ssh/config created
- Host aliases work
- Jump hosts configured (if needed)
- Keys automatically selected
Security:
- Passphrases used on shared machines
- ForwardAgent disabled by default
- StrictHostKeyChecking enabled
- Modern ciphers only
Integration with Other Skills
Combine with:
- kubernetes-devops - SSH to K8s nodes for debugging
- task-development-workflow - Deploy via SSH in CI/CD
- github-ops - Git over SSH with multiple identities
Example workflow:
- Generate keys (this skill)
- Configure servers (this skill)
- Set up deployment pipeline (task-development-workflow)
- Deploy to K8s (kubernetes-devops)
References
Official Documentation:
- OpenSSH Manual: https://www.openssh.com/manual.html
- ssh_config(5):
man ssh_config - sshd_config(5):
man sshd_config
Security Guidelines:
- Mozilla SSH Guidelines: https://infosec.mozilla.org/guidelines/openssh
- NIST SP 800-52: Guidelines for SSH
- https://stribika.github.io/2015/01/04/secure-secure-shell.html
Best Practices:
Meta: Skill Quality
Incorporates Karpathy Principles:
- ✅ Think Before Coding - Key type and security level assessment
- ✅ Simplicity First - One key per identity, minimal config
- ✅ Surgical Changes - Incremental server hardening with verification
- ✅ Goal-Driven Execution - Testable connection success criteria
Originality: Written from scratch, inspired by OpenSSH docs, Mozilla guidelines, NIST
Testing: Used across 20+ servers, multiple environments
License: MIT
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

