ssh-configuration
Skill này làm gì
Công cụ này giúp thiết lập và bảo mật việc truy cập máy tính từ xa bằng SSH. Nó cho phép bạn quản lý khóa bảo mật, tạo đường hầm cho các kết nối an toàn và điều chỉnh cài đặt máy chủ để bảo vệ tốt hơn.
Khi nào nên dùng
- ✓Khi thiết lập truy cập an toàn vào một máy chủ Linux.
- ✓Khi cần bảo vệ việc giao tiếp giữa các máy tính.
- ✓Khi quản lý khóa truy cập cho nhiều người.
Liên kết skill
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/ssh-configuration/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Làm sao để cấu hình máy tính của tôi truy cập máy chủ từ xa bằng khóa một cách an toàn?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Công cụ tạo và quản lý các khóa bảo mật (giống như mật khẩu đặc biệt), rồi cấu hình các tệp để SSH biết cách kết nối an toàn. Việc này bao gồm thiết lập quy tắc trên cả máy chủ lẫn máy khách.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
SSH Configuration
Secure SSH server and client configuration for production environments, including key management, hardened sshd settings, bastion host architecture, tunneling, and multiplexing.
When to Use
- Setting up secure remote access to Linux or Unix servers
- Hardening SSH daemon configuration to meet compliance requirements
- Configuring bastion / jump hosts for private network access
- Creating SSH tunnels for secure port forwarding
- Managing SSH keys for teams or automated deployments
- Troubleshooting connection, authentication, or performance issues
Prerequisites
- OpenSSH client installed locally (
ssh -Vto verify) - OpenSSH server installed on target (
sshd) - Root or sudo access on the server for sshd_config changes
- Firewall rules allowing TCP port 22 (or custom SSH port)
Key Generation and Management
# Generate an Ed25519 key (recommended -- fast, secure, short)
ssh-keygen -t ed25519 -C "jane@example.com" -f ~/.ssh/id_ed25519
# Generate an RSA 4096-bit key (for legacy compatibility)
ssh-keygen -t rsa -b 4096 -C "jane@example.com" -f ~/.ssh/id_rsa_legacy
# Generate a key with a custom comment and no passphrase (CI/CD use only)
ssh-keygen -t ed25519 -C "ci-deploy-key" -f ~/.ssh/ci_deploy -N ""
# Copy public key to a remote server
ssh-copy-id -i ~/.ssh/id_ed25519.pub user@server
# Manually append a public key (when ssh-copy-id is unavailable)
cat ~/.ssh/id_ed25519.pub | ssh user@server "mkdir -p ~/.ssh && chmod 700 ~/.ssh && cat >> ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys"
# List fingerprints of keys on the agent
ssh-add -l
# Start the SSH agent and add a key
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
# Add a key with a lifetime (auto-removed after 8 hours)
ssh-add -t 28800 ~/.ssh/id_ed25519
# Remove all keys from the agent
ssh-add -D
# Convert an OpenSSH key to PEM format (for tools that need it)
ssh-keygen -p -m PEM -f ~/.ssh/id_rsa_legacy
# Show the public key fingerprint (SHA256)
ssh-keygen -lf ~/.ssh/id_ed25519.pub
# Rotate a key: generate new, deploy, then revoke old
ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519_new -C "jane@example.com rotated $(date +%Y-%m)"
ssh-copy-id -i ~/.ssh/id_ed25519_new.pub user@server
# After verifying the new key works, remove the old public key from authorized_keys on the server
SSH Client Configuration (~/.ssh/config)
# Global defaults applied to all hosts
Host *
AddKeysToAgent yes
IdentitiesOnly yes
ServerAliveInterval 60
ServerAliveCountMax 3
TCPKeepAlive yes
Compression yes
# Production servers via bastion
Host bastion
HostName bastion.example.com
User ops
IdentityFile ~/.ssh/id_ed25519
Port 22
Host prod-web-*
User deploy
IdentityFile ~/.ssh/id_ed25519
ProxyJump bastion
Port 22
Host prod-web-1
HostName 10.0.1.10
Host prod-web-2
HostName 10.0.1.11
# Staging accessed directly
Host staging
HostName staging.example.com
User deploy
IdentityFile ~/.ssh/id_ed25519_staging
# Database tunnel through bastion
Host db-tunnel
HostName 10.0.2.50
User dba
ProxyJump bastion
LocalForward 5432 localhost:5432
# GitHub deploy key
Host github-deploy
HostName github.com
User git
IdentityFile ~/.ssh/github_deploy_key
IdentitiesOnly yes
# Connection multiplexing for faster repeated connections
Host fast-*
ControlMaster auto
ControlPath ~/.ssh/sockets/%r@%h-%p
ControlPersist 600
# Create the sockets directory for multiplexing
mkdir -p ~/.ssh/sockets
chmod 700 ~/.ssh/sockets
Hardened Server Configuration (/etc/ssh/sshd_config)
# /etc/ssh/sshd_config -- hardened configuration
# -----------------------------------------------
# Listen on a non-default port (obscurity, not security -- combine with firewall)
Port 22
# Protocol and key exchange
Protocol 2
KexAlgorithms curve25519-sha256,curve25519-sha256@libssh.org,diffie-hellman-group16-sha512
Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com
MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com
# Authentication
PermitRootLogin no
PasswordAuthentication no
PubkeyAuthentication yes
AuthenticationMethods publickey
MaxAuthTries 3
MaxSessions 5
LoginGraceTime 30
# Restrict users and groups
AllowGroups ssh-users ops-team
# AllowUsers deploy admin
# Disable unused authentication methods
ChallengeResponseAuthentication no
KerberosAuthentication no
GSSAPIAuthentication no
# Forwarding controls
AllowTcpForwarding yes
…
Câu hỏi thường gặp
SSH là gì?
SSH (Secure Shell) là giao thức mạng cho phép hai máy tính giao tiếp an toàn qua internet. Nó giống như một đường hầm mã hóa cho lệnh và dữ liệu của bạn.
Vì sao dùng khóa thay vì mật khẩu?
Khóa an toàn hơn mật khẩu vì khó đoán hoặc khó bị đánh cắp hơn. Chúng cũng cho phép kết nối mà không cần gõ mật khẩu mỗi lần, tiện hơn.
Đường hầm SSH là gì?
Đường hầm SSH tạo một kết nối an toàn để truyền các loại lưu lượng mạng khác. Nó giống như dùng đường hầm SSH để gửi dữ liệu cho một ứng dụng vốn không an toàn.
Chi tiết
Mô tả gốc của tác giả
Configure SSH servers and clients securely. Manage keys, tunnels, and config files. Use when setting up secure remote access.
Độ phổ biến
- Sao GitHub
- 48k
- Vị trí xếp hạng
- #5853
- Giấy phép
- MIT
- Cập nhật
- 15/10/2026
Bình luận
- …
Thêm skill từ kho mã này
00-andruia-consultant
48kGiúp agent của bạn bắt đầu hoặc cải thiện các dự án AI. Phân tích mã, gợi ý công cụ và lập kế hoạch hành động bằng tiếng Tây Ban Nha.
007
48kCho phép agent của bạn thực hiện kiểm toán bảo mật và mô hình hóa mối đe dọa. Hữu ích để bảo vệ dự án khỏi các cuộc tấn công và lỗ hổng.
10-andruia-skill-smith
48kGiúp agent của bạn tạo hoặc cải thiện các công cụ AI. Xác định cách công cụ hoạt động, viết tài liệu và kiểm tra cấu trúc.
20-andruia-niche-intelligence
48kGiúp agent của bạn tạo bản tóm tắt về một ngành cụ thể. Hữu ích để hiểu bối cảnh, quy tắc, cách người dùng tương tác và rủi ro của dự án.
Skill tương tự
reverse-engineer-anything
422kGiúp agent của bạn xem bên trong các app và package đã phát hành để giải thích tính năng, so sánh phiên bản hoặc hướng dẫn dựng lại bằng công cụ REA.
1password
394kGiúp agent của bạn cài đặt CLI của 1Password, đăng nhập, và đọc hoặc đưa thông tin bí mật vào mà không in giá trị ra cuộc trò chuyện.
healthcheck
394kGiúp agent của bạn rà soát bảo mật máy tính hoặc máy chủ đang chạy OpenClaw, như SSH, tường lửa, cập nhật và sao lưu, rồi đề xuất cách sửa an toàn.