Ssh Connection logo

Ssh Connection

Community
I-You-Dream
ssh-connection

This skill should be used when the user asks to "连接服务器", "SSH连接", "配置服务器SSH", "远程服务器配置", "ssh -p", "SSH密钥配置", "服务器密钥认证", "SSH key setup", "remote server connection"

Overview

PublisherI-You-Dream
Repositoryssh-connection
Skill namessh-connection
Stars
36
Forks
0
Bundled files
11
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 11 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by I-You-Dream on GitHub. Read the source before you install it.

Installation

Install the Ssh Connection AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/I-You-Dream/ssh-connection/tree/main
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/I-You-Dream/ssh-connection.git \
  .claude/skills/ssh-connection
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Ssh Connection in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Ssh Connection on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Ssh Connection is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

SSH 连接配置技能

概述

配置远程服务器的 SSH 密钥认证。配置完成后,直接使用标准 SSH/SCP 命令操作服务器。

范围:仅负责连接配置,不包含命令执行和文件传输功能。

服务器类型:

  • 普通云服务器:Host/Port 不变
  • 代理式实例(如 AutoDL):重启后 Host/Port 可能改变

调用方式

/ssh-connection <输入>

支持格式:ssh -p 端口 user@host、host:port、user@host、host

脚本目录

~/.claude/skills/ssh-connection/scripts/
├── config.py           # 配置文件
├── host_key.py         # 主机密钥策略(accept-new)
├── deploy_key.py       # 推送公钥(SFTP 写入,密码走环境变量)
├── generate_key.ps1    # 生成密钥(Windows)
├── generate_key.sh     # 生成密钥(macOS / Linux)
├── ensure_config.ps1   # 确保 SSH Config 存在(Windows)
├── ensure_config.sh    # 确保 SSH Config 存在(macOS / Linux)
├── get_server_id.py    # 获取服务器身份
├── logger.py           # 操作日志
└── server_meta.py      # 元数据管理

数据存储

  • SSH Config:~/.ssh/config(权威源)
  • known_hosts:~/.ssh/known_hosts(主机密钥)
  • 元数据:~/.ssh_manager/servers.json(hostname、machine_id、时间戳)
  • 操作日志:~/.ssh_manager/operations.log(JSON Lines)

处理流程

步骤 1:解析输入

提取 host、port(默认22)、user(默认root)。

步骤 2:检查配置

读取 ~/.ssh/config,匹配 host+port+user。

已配置 → 跳转步骤 4(测试连接)

未配置 → 检测地址变化(见下方)

地址变化检测

条件:相同 user,不同 host/port

  1. 用已有密钥连接新地址
  2. 获取 hostname + machine_id
  3. 与 servers.json 比对
  4. 匹配 → 更新配置;不匹配 → 询问用户

步骤 3:配置新服务器

  1. 生成别名:域名取首段,IP取末段
  2. 询问密码:内存使用,不存储
  3. 生成密钥:generate_key.ps1 / generate_key.sh
  4. 推送公钥:deploy_key.py(密码通过 SSH_PASSWORD 环境变量传递,SFTP 写入)
  5. 写入 SSH Config
  6. 保存元数据

步骤 4:测试连接

powershell
ssh <别名> "hostname && echo CONNECTION_OK"

步骤 5:响应结果

连接成功 → 提示可用命令 连接失败 → 报告错误原因

异常处理

异常处理
别名冲突自动追加后缀
密码错误重试(最多3次)
连接失败报告错误
地址变化多维度验证
主机密钥变化拒绝连接并告警(可能为 MITM)

安全约束

  1. 密码不存储,只通过 SSH_PASSWORD 环境变量传递,不接受命令行参数
  2. 不打印密码到日志
  3. 公钥经 SFTP 写入 authorized_keys,不经 shell 插值,杜绝注入
  4. 主机密钥 accept-new:未知主机首次接受并记录;密钥变化时拒绝连接并告警
  5. 冲突时追加后缀,不覆盖已有配置

维护命令

bash
# 列出服务器
python scripts/server_meta.py list

# 清理死服务器(仅提示,不自动删除)
python scripts/server_meta.py cleanup 30

# 删除服务器
python scripts/server_meta.py remove <alias>

# 查看操作日志
python scripts/logger.py show 20

版本历史

版本日期变更
1.2.02026-10-25安全加固:主机密钥 accept-new 策略、SFTP 写入防注入、移除密码命令行参数;跨平台(macOS/Linux);原子化写入元数据
1.1.02025-08-15安全优化:密码通过环境变量传递;添加操作日志;精简文档
1.0.02025-08-15初始版本

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Ssh Connection AI skill do?

This skill should be used when the user asks to "连接服务器", "SSH连接", "配置服务器SSH", "远程服务器配置", "ssh -p", "SSH密钥配置", "服务器密钥认证", "SSH key setup", "remote server connection"

Why use Ssh Connection on TypingMind?

Because you install it once and use it with any model. Ssh Connection is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Ssh Connection in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/I-You-Dream/ssh-connection/tree/main. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Ssh Connection?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Ssh Connection?

As many as you like. As long as a model supports skills, you can use Ssh Connection with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Ssh Connection AI skill free?

Yes. It is published on GitHub by I-You-Dream under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇