云原生教程之使用docker部署webssh工具sshwifty-kb88凯时官网登录

来自:网络
时间:2023-05-17
阅读:
免费资源网 - https://freexyz.cn/
目录

一、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

六、访问sshwiftykb88凯时d88尊龙官网手机app官网登录首页

七、sshwifty的基本使用

1.进入连接选项界面

2.选择ssh连接

填写服务器ip地址等信息,选择认证方式

3.认证信息配置

4.远程ssh连接服务器

5.查看连接延迟状态

总结 

免费资源网 - https://freexyz.cn/
返回顶部
顶部
网站地图