ssh config example
在线生成可直接粘贴到 `~/.ssh/config` 的 SSH 配置示例
支持基础主机、跳板机场景和本地端口转发,边填边生成,复制后就能直接放进你的 SSH config 文件。
右侧预览会随着输入实时更新。
快速模板
连接信息
高级选项
生成结果
复制下面这段内容,粘贴到你的 SSH config 文件即可。
建议放置位置: ~/.ssh/config
# Generated by DartShell tools
# Paste this into ~/.ssh/config
Host prod-api
HostName 203.0.113.10
User ubuntu
Port 22
IdentityFile ~/.ssh/id_ed25519
IdentitiesOnly yes
ServerAliveInterval 60
ServerAliveCountMax 3这个 SSH config example 能帮你生成什么
基础主机别名
给服务器起一个短别名后,就可以直接执行 `ssh prod-api`,不用每次都手敲完整地址。
跳板机连接
如果目标服务器只能先连堡垒机或跳板机,再通过它进入内网,就可以加上 `ProxyJump`。
本地端口转发
通过 `LocalForward` 把本地端口映射到远端服务,数据库和内部面板场景会很常见。
常见示例
普通云服务器
Host app-server
HostName 203.0.113.10
User ubuntu
Port 22
IdentityFile ~/.ssh/id_ed25519经由跳板机访问
Host internal-db
HostName 10.0.1.24
User ec2-user
ProxyJump bastion
IdentityFile ~/.ssh/id_ed25519数据库端口转发
Host reporting-db
HostName 192.168.10.12
User ops
LocalForward 5432 127.0.0.1:5432
ServerAliveInterval 60