使用浏览器进行SSH连接——Sshwifty
介绍
Sshwifty 是一个开源的网络SSH客户端,使你能够连接到 SSH 服务器而无需下载任何额外的软件。
同时也支持 Telnet
部署
下载并配置
下载构建好的二进制文件到服务器上,解压。
将示例配置文件 sshwifty.conf.example.json
重命名为 sshwifty.conf.json
。
修改配置文件,各项作用就不多解释了。
应该都看得懂,有疑问可以再看看 README。
{
"HostName": "",
"SharedKey": "web访问密码(留空则不验证)",
"DialTimeout": 5,
"Socks5": "",
"Socks5User": "",
"Socks5Password": "",
"Servers": [
{
"ListenInterface": "0.0.0.0",
"ListenPort": 8182,
"InitialTimeout": 3,
"ReadTimeout": 60,
"WriteTimeout": 60,
"HeartbeatTimeout": 20,
"ReadDelay": 10,
"WriteDelay": 10,
"TLSCertificateFile": "",
"TLSCertificateKeyFile": ""
}
],
"Presets": [],
"OnlyAllowPresetRemotes": false
}
配置为服务 (systemd)
修改 /etc/systemd/system/sshwifty.service
文件
[Unit]
Description = sshwifty
After = network.target syslog.target
Wants = network.target
[Service]
Type = simple
#下面两项修改为实际路径
ExecStart = /home/sshwifty/sshwifty_linux_amd64
WorkingDirectory=/home/sshwifty
[Install]
WantedBy = multi-user.target
systemctl enable sshwifty #启用服务
systemctl start sshwifty #启动服务
现在有好多webssh项目, 比如:
https://github.com/huashengdun/webssh
https://hub.docker.com/r/jrohy/webssh
https://hub.docker.com/r/billchurch/webssh2
https://hub.docker.com/r/shellngn/pro
https://github.com/nirui/sshwifty
也有好多免费的容器平台, 像这样的WEBSSH占用流量很少, 放免费平台上也没问题.
这是一系列教程:
https://zelikk.blogspot.com/search/label/webssh
koyeb 平台 和 fly.io 平台可以支持SSH登录到IPv6的VPS
https://zelikk.blogspot.com/2023/10/github-codespaces-flyio-webssh.html
https://zelikk.blogspot.com/2023/10/huashengdun-webssh-codesandbox.html