Docker部署WebSSH神器,轻松搞定远程管理!
- 1.sshwifty简介
- 2.shwifty 特点
- 1.检查docker版本
- 2.检查docker状态
- 1.创建部署目录
- 2.创建sshwifty容器
- 3.查看sshwifty容器状态
- 1.进入连接选项界面
- 2.选择ssh连接
- 3.认证信息配置
- 4.SSH远程连接服务器
一、sshwifty介绍
1.sshwifty简介
sshwifty是一款Web SSH & Telnet(WebSSH & WebTelnet 客户端工具。
2.shwifty 特点
shwifty 是为 Web 设计的 SSH 和 Telnet 连接器。它可以部署在您的计算机或服务器上,为任何兼容(标准)的网络浏览器提供 SSH 和 Telnet 访问接口。
二、检查本地docker环境
1.检查docker版本
[root@jeven ~]# docker version Client: Docker Engine - Community Version: 20.10.21 API version: 1.41 Go version: go1.18.7 Git commit: baeda1f Built: Tue Oct 25 18:04:24 2022 OS/Arch: linux/amd64 Context: default Experimental: true Server: Docker Engine - Community Engine: Version: 20.10.21 API version: 1.41 (minimum version 1.12) Go version: go1.18.7 Git commit: 3056208 Built: Tue Oct 25 18:02:38 2022 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.6.12 GitCommit: a05d175400b1145e5e6a735a6710579d181e7fb0 runc: Version: 1.1.4 GitCommit: v1.1.4-0-g5fd4c4d docker-init: Version: 0.19.0 GitCommit: de40ad0
2.检查docker状态
[root@jeven ~]# systemctl status docker ● docker.service - Docker Application Container Engine Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled) Active: active (running) since Sat 2022-12-10 02:07:56 CST; 1 day 16h ago Main PID: 3200 (dockerd) Tasks: 51 Memory: 2.2G CGroup: /system.slice/docker.service
三、下载sshwifty镜像
[root@jeven ~]# docker pull niruix/sshwifty:latest latest: Pulling from niruix/sshwifty 59bf1c3509f3: Already exists eb8f919181be: Pull complete 21facffd2b84: Pull complete ea1365dbf4a0: Pull complete latest: Pulling from niruix/sshwifty 213ec9aee27d: Already exists db074b00f828: Pull complete af1b674602a2: Pull complete 5f786aa6e56f: Pull complete Digest: sha256:410a48bbce146d01ca7e5f20ff67e55dfdab5afbe46ae41ad696d659c6856670 Status: Downloaded newer image for niruix/sshwifty:latest docker.io/niruix/sshwifty:latest
四、服务器生成凭证文件
[root@jeven ~]# openssl req -newkey rsa:4096 -nodes -keyout domain.key -x509 -days 90 -out domain.crt Generating a 4096 bit RSA private key ...........................................................................................................++ ...++ writing new private key to 'domain.key' ----- You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [XX]: State or Province Name (full name) []: Locality Name (eg, city) [Default City]: Organization Name (eg, company) [Default Company Ltd]: Organizational Unit Name (eg, section) []: Common Name (eg, your name or your server's hostname) []: Email Address []:
五、创建sshwifty容器
1.创建部署目录
mkdir -p /data/sshwifty
2.创建sshwifty容器
docker run --detach --restart always --publish 8182:8182 --env SSHWIFTY_DOCKER_TLSCERT="$(cat domain.crt)" --env SSHWIFTY_DOCKER_TLSCERTKEY="$(cat domain.key)" --name sshwifty niruix/sshwifty:latest
3.查看sshwifty容器状态
[root@jeven ~]# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES d03202a5cce7 niruix/sshwifty:latest "/sshwifty.sh" 8 hours ago Up 8 hours 0.0.0.0:8182->8182/tcp, :::8182->8182/tcp sshwifty
六、访问sshwifty首页
七、sshwifty的基本使用
1.进入连接选项界面
访问地址:https://192.168.3.166:8182/,注意将IP替换为自己服务器IP地址。
2.选择ssh连接
填写服务器IP地址等信息,选择密码验证,点击连接。
3.认证信息配置
输入系统的登录密码,点击“登录”即可。
4.SSH远程连接服务器
可以看到已经成功SSH远程连接到服务器,进入网页版webssh终端。
点击标签页的绿色小灯,可以查看SSH连接的延迟状态。
八、总结
sshwifty是一款便捷的Web SSH和Telnet客户端工具,它能够在任何现代浏览器中轻松实现对远程服务器的安全连接和管理。通过将其部署在个人电脑或服务器上,用户无需安装额外软件即可享受流畅的远程访问体验。此外,它的轻量级特性和简单易用的界面让远程工作变得更加高效和直观。sshwifty是一个理想的解决方案,尤其适合需要频繁进行远程维护和技术支持的场景。
作者声明本文无利益相关,欢迎值友理性交流,和谐讨论~
,