首页 > 其他分享 >云原生之使用Docker部署webssh工具sshwifty

云原生之使用Docker部署webssh工具sshwifty

时间:2023-05-01 10:31:41浏览次数:39  
标签:12 container webssh 2022 sshwifty docker jeven Docker

(云原生之使用Docker部署webssh工具sshwifty)

一、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
     Docs: https://docs.docker.com
 Main PID: 3200 (dockerd)
    Tasks: 51
   Memory: 2.2G
   CGroup: /system.slice/docker.service
           ├─ 3200 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
           ├─10894 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 8777 -container-ip 192.168.144.3 -container-port 80
           ├─10900 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 8777 -container-ip 192.168.144.3 -container-port 80
           ├─47983 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 8030 -container-ip 192.168.160.4 -container-port 8002
           ├─47989 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 8030 -container-ip 192.168.160.4 -container-port 8002
           ├─79289 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 8182 -container-ip 172.17.0.2 -container-port 8182
           └─79295 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 8182 -container-ip 172.17.0.2 -container-port 8182

Dec 10 17:59:26 jeven dockerd[3200]: time="2022-12-10T17:59:26.025354968+08:00" level=info msg="ignoring event" container=f12196399ec79af5...skDelete"
Dec 10 17:59:29 jeven dockerd[3200]: time="2022-12-10T17:59:29.686116328+08:00" level=info msg="ignoring event" container=f12196399ec79af5...skDelete"
Dec 10 18:23:34 jeven dockerd[3200]: time="2022-12-10T18:23:34.990641014+08:00" level=info msg="ignoring event" container=c663d02e84709140...skDelete"
Dec 10 18:26:49 jeven dockerd[3200]: time="2022-12-10T18:26:49.278375069+08:00" level=info msg="ignoring event" container=c261a231fd3a667e...skDelete"
Dec 10 18:30:06 jeven dockerd[3200]: time="2022-12-10T18:30:06.474584540+08:00" level=info msg="ignoring event" container=c030677ef4c374ce...skDelete"
Dec 10 18:56:18 jeven dockerd[3200]: time="2022-12-10T18:56:18.697839686+08:00" level=info msg="ignoring event" container=1dee36827375e093...skDelete"
Dec 10 21:38:37 jeven dockerd[3200]: time="2022-12-10T21:38:37.225136574+08:00" level=info msg="ignoring event" container=9eb379c6b627f271...skDelete"
Dec 11 11:25:12 jeven dockerd[3200]: time="2022-12-11T11:25:12.020544314+08:00" level=info msg="Attempting next endpoint for pull after er...er Error"
Dec 11 11:39:16 jeven dockerd[3200]: time="2022-12-11T11:39:16.374445047+08:00" level=info msg="Container failed to exit within 10s of sig...ee64e0fee
Dec 11 11:39:16 jeven dockerd[3200]: time="2022-12-11T11:39:16.417759049+08:00" level=info msg="ignoring event" container=a8ec136f38e4cfa8...skDelete"
Hint: Some lines were ellipsized, use -l to show in full.

三、下载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.进入连接选项界面

在这里插入图片描述

2.选择ssh连接

填写服务器IP地址等信息,选择认证方式 在这里插入图片描述

3.认证信息配置

在这里插入图片描述

4.远程ssh连接服务器

在这里插入图片描述

5.查看连接延迟状态

在这里插入图片描述

标签:12,container,webssh,2022,sshwifty,docker,jeven,Docker
From: https://blog.51cto.com/u_14664141/6238626

相关文章

  • 如何给正在运行的docker容器添加端口映射
    我们都知道启动docker容器的时候可以使用-d参数进行端口映射,但是如果你的容器已经创建出来了但是突然又想要添加一个端口映射,这时总不能重新创建一个容器吧,之前的工作不都白费了吗有一个办法就是先将当前已经配置过的容器打包成新的镜像,然后用这个镜像生成一个新的容器,这样所做的......
  • 制作一个包含Centos7+Nginx+Mysql8+JDK8的Docker镜像
    1.创建一个文件夹用于构建Docker镜像:mkdirmy-docker-imagecdmy-docker-image2.在该文件夹中创建一个名为Dockerfile的文件。vimDockerfile3.在Dockerfile中编写以下代码:FROMcentos:7#RUNsed-i's/deb.debian.org/mirrors.aliyun.com/g'/etc/apt/sources.list......
  • Dockers下php容器中安装redis扩展
    首先进入php容器dockerexec-it容器ID或名称查看php安装位置  whichphp查看php已安装扩展  php-m1、下载redis扩展包   redis扩展下载地址【https://pecl.php.net/package/redis 】下载相应版本的扩展2、解压扩展包   tar-zxvfredis-5.1.1.tg......
  • 使用docker快速安装mongodb.md
    1.拉取mongodb镜像dockerpullmongo2.创建文件夹mkdir-p/home/mongo/conf/mkdir-p/home/mongo/data/mkdir-p/home/mongo/logs/3.新增mongod.conf文件cd/home/mongo/conf&&vimongod.confmongod.conf文件内容:#数据库文件存储位置dbpath=/data/db#log文......
  • 使用docker快速安装mysql.md
    1.拉取mysql镜像dockerpullmysql:8.0.182.docker容器构建和运行mysqldockerrun--namemysql\ -p3306:3306\-eMYSQL_ROOT_PASSWORD=123456\ -v/home/mysql/data:/var/lib/mysql:rw\-v/home/mysql/mysql-files:/var/lib/mysql-files:rw\-v/home/......
  • Docker
    #1、yum包更新到最新yumupdate#2、安装需要的软件包,yum-util提供yum-config-manager功能,另外两个是devicemapper驱动依赖的yuminstall-yyum-utilsdevice-mapper-persistent-datalvm2#3、设置yum源yum-config-manager--add-repohttps://download.docker.com/linux......
  • linux安装docker-compose
    手动安装docker-compose1)下载地址https://github.com/docker/compose/2)第一种方法将下载的文件放入bin目录下mvdocker-compose-linux-x86_64docker-composecpdocker-compose/usr/bin/chmod+x/usr/bin/docker-composedocker-compose--version3)第三种方法创造软......
  • Docker的一些常用命令
    Docker是一种容器化技术,需要使用许多命令来管理和操作容器。下面是对一些常用的Docker命令和它们的含义的解释:-v:用来将文件或者目录挂载到Docker容器中,使其可以在Docker容器内部进行访问。格式为-v/host/path:/container/path,其中/host/path是本地主机的文件路径,/conta......
  • Windows Docker 配置国内镜像源的两种方法
    更新时间2023.04.30版本号:23.0.5通过Docker-Desktop界面操作和修改daemon.json两种方法配置国内镜像源方法一:通过Docker-Desktop配置1.点击设置2.选择DockerEngine3.添加以下源地址"registry-mirrors":["https://docker.mirrors.ustc.edu.cn","https:/......
  • Windows下安装Docker详细过程及问题解决
    官方手册供参考:https://docs.docker.com/desktop/windows/一:什么是Docker?Docker是一个开放源代码软件,是一个开放平台,用于开发应用、交付(shipping)应用、运行应用。Docker允许用户将基础设施(Infrastructure)中的应用单独分割出来,形成更小的颗粒(容器),从而提高交付软件的速度。Dock......