偶尔用一下网页版的ssh工具还是挺方便的,还是有很多在线ssh工具的,还是不如自己搭建一个。
1、huashengdun/webssh,基于python,可以使用python和docker安装。
pip install webssh # 运行 wssh --address='0.0.0.0' --port=8182 --certfile='/root/.../fullchain.cer' --keyfile='/root/.../xxx.key' # 命令行参数 --help # 帮助 --address # 监听地址 --port=8182 # 监听端口 --certfile # 证书 --keyfile= # 证书key
使用吃灰服务器搭建了一个:https://ssh.zsxwz.com/
服务器还有半年到期,没有打算续费,所以随时可能删除。
支持ipv6,主要是方便ipv6 only的小鸡,一些vps有ipv4也有ipv6,ipv4可能墙了,或许ipv6还可以连上。

2、ttyd,基于C,使用比较简单,下载release即可使用:
https://github.com/tsl0922/ttyd/releases
wget -O ttyd https://github.com/tsl0922/ttyd/releases/download/1.6.3/ttyd.x86_64 chmod +x ttyd # 运行 ./ttyd -p 1234 su root # 常用命令行选项 -p # 端口 -i # 网卡 -c # 设置,用户名:密码 -S # 设置ssl -C # 证书certificate -K #证书key -h 帮助

3、sshwifty,基于go和JavaScript,界面是挺好看的,下载release即可使用,或者使用node安装,也可以使用docker安装,还可以安装到heroku。https://github.com/nirui/sshwifty/releases/tag/0.2.10-beta-release-prebuild
配置文件:sshwifty.conf.json,可以放在~/.config/sshwifty.conf.json,或者放在/etc/sshwifty.conf.json
需要使用https,否则无法验证登录。
{
"HostName": "",
"SharedKey": "打开网站密码",
"DialTimeout": 5,
"Socks5": "",
"Socks5User": "",
"Socks5Password": "",
"Servers": [
{
"ListenInterface": "0.0.0.0", //没有公网ip用127.0.0.1
"ListenPort": 8182, //监听端口
"InitialTimeout": 3,
"ReadTimeout": 60,
"WriteTimeout": 60,
"HeartbeatTimeout": 20,
"ReadDelay": 10,
"WriteDelay": 10,
"TLSCertificateFile": "",
"TLSCertificateKeyFile": ""
}
],
"Presets": [
{
"Title": "SDF.org Unix Shell",
"Type": "SSH",
"Host": "sdf.org:22",
"Meta": {
"Encoding": "utf-8",
"Authentication": "Password"
}
},
{
"Title": "My own super secure server",
"Type": "SSH",
"Host": "localhost",
"Meta": {
"User": "root",
"Encoding": "utf-8",
"Private Key": "-----BEGIN RSA PRIV...\nMIIE...\n-----END RSA PRI...\n",
"Authentication": "Private Key",
"Fingerprint": "SHA256:bgO...."
}
},
{
"Title": "My own super expensive router",
"Type": "Telnet",
"Host": "10.0.0.1",
"Meta": {
"Encoding": "ibm866"
}
}
],
"OnlyAllowPresetRemotes": false
}

4、Next Terminal,基于Golang和React,不仅仅支持ssh,还支持rdp,vnc,适合管理自己的资产。
下载release运行即可:https://github.com/dushixiang/next-terminal/releases

5、webssh,基于go,简易在线ssh和sftp工具,目前还不支持密钥登录。下载release运行即可:https://github.com/Jrohy/webssh/releases,也可以使用docker安装。
-a string
开启账号密码登录验证, '-a user:pass'的格式传参
-p int
服务运行端口 (default 5032)
-t int
ssh连接超时时间(min) (default 120)
-s 保存ssh密码
-v 显示版本号

交流交流, 我找到的一些webssh项目
https://hub.docker.com/r/jrohy/webssh
https://hub.docker.com/r/billchurch/webssh2
https://hub.docker.com/r/shellngn/pro
在线可用的实例
https://sshwifty-demo.nirui.org/
https://terminal.xyun.cloud/
https://ssh1984.fly.dev/
https://ssh-crazypeace.koyeb.app/
也有好多免费的容器平台, 像这样的WEBSSH占用流量很少, 放免费平台上也没问题.
这是一系列教程:
https://zelikk.blogspot.com/search/label/webssh