npx skills add https://github.com/openhands/skills --skill ssh此技能提供建立和管理远程机器 SSH 连接的能力。
ssh username@hostname
当提示时,您应该向用户询问其密码或私钥。
生成新的 SSH 密钥对:
ssh-keygen -t ed25519 -f ~/.ssh/key_name -C "comment" -N ""
将公钥复制到远程服务器:
ssh-copy-id -i ~/.ssh/key_name.pub username@hostname
使用私钥连接:
ssh -i ~/.ssh/key_name username@hostname
创建或编辑 SSH 配置文件以便于连接:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
mkdir -p ~/.ssh
cat > ~/.ssh/config << 'EOF'
Host alias
HostName hostname_or_ip
User username
IdentityFile ~/.ssh/key_name
Port 22
ServerAliveInterval 60
EOF
chmod 600 ~/.ssh/config
然后使用别名连接:
ssh alias
-p PORT: 连接到指定端口-X: 启用 X11 转发-L local_port:remote_host:remote_port: 设置本地端口转发-R remote_port:local_host:local_port: 设置远程端口转发-N: 不执行远程命令(适用于端口转发)-f: 在后台运行-v: 详细模式(添加更多 v 以增加详细程度)将文件复制到远程服务器:
scp /path/to/local/file username@hostname:/path/to/remote/directory/
从远程服务器复制文件:
scp username@hostname:/path/to/remote/file /path/to/local/directory/
递归复制目录:
scp -r /path/to/local/directory username@hostname:/path/to/remote/directory/
启动 SSH 代理:
eval "$(ssh-agent -s)"
向代理添加密钥:
ssh-add ~/.ssh/key_name
systemctl status sshdnc -zv hostname 22ssh -vvv username@hostnamechmod 600 ~/.ssh/key_name)ssh-keygen -R hostname 删除旧条目最基本的方法是确保正确的文件权限:
# 为私钥设置正确的权限
chmod 600 ~/.ssh/id_ed25519
# 为公钥设置正确的权限
chmod 644 ~/.ssh/id_ed25519.pub
# 为 SSH 目录设置正确的权限
chmod 700 ~/.ssh
每周安装数
253
代码仓库
GitHub 星标数
75
首次出现
Jan 24, 2026
安全审计
安装于
opencode232
codex228
gemini-cli223
github-copilot213
cursor212
kimi-cli206
This skill provides capabilities for establishing and managing SSH connections to remote machines.
ssh username@hostname
When prompted, you should ask the user for their password or a private key.
Generate a new SSH key pair:
ssh-keygen -t ed25519 -f ~/.ssh/key_name -C "comment" -N ""
Copy the public key to the remote server:
ssh-copy-id -i ~/.ssh/key_name.pub username@hostname
Connect using the private key:
ssh -i ~/.ssh/key_name username@hostname
Create or edit the SSH config file for easier connections:
mkdir -p ~/.ssh
cat > ~/.ssh/config << 'EOF'
Host alias
HostName hostname_or_ip
User username
IdentityFile ~/.ssh/key_name
Port 22
ServerAliveInterval 60
EOF
chmod 600 ~/.ssh/config
Then connect using the alias:
ssh alias
-p PORT: Connect to a specific port-X: Enable X11 forwarding-L local_port:remote_host:remote_port: Set up local port forwarding-R remote_port:local_host:local_port: Set up remote port forwarding-N: Do not execute a remote command (useful for port forwarding)-f: Run in background-v: Verbose mode (add more v's for increased verbosity)Copy a file to the remote server:
scp /path/to/local/file username@hostname:/path/to/remote/directory/
Copy a file from the remote server:
scp username@hostname:/path/to/remote/file /path/to/local/directory/
Copy a directory recursively:
scp -r /path/to/local/directory username@hostname:/path/to/remote/directory/
Start the SSH agent:
eval "$(ssh-agent -s)"
Add a key to the agent:
ssh-add ~/.ssh/key_name
systemctl status sshdnc -zv hostname 22ssh -vvv username@hostnamechmod 600 ~/.ssh/key_name)ssh-keygen -R hostnameThe most basic approach is to ensure proper file permissions:
# Set correct permissions for private keys
chmod 600 ~/.ssh/id_ed25519
# Set correct permissions for public keys
chmod 644 ~/.ssh/id_ed25519.pub
# Set correct permissions for SSH directory
chmod 700 ~/.ssh
Weekly Installs
253
Repository
GitHub Stars
75
First Seen
Jan 24, 2026
Security Audits
Gen Agent Trust HubFailSocketPassSnykFail
Installed on
opencode232
codex228
gemini-cli223
github-copilot213
cursor212
kimi-cli206