有没有想过在浏览器连接终端?一般情况下咱们使用终端工具通过ssh协议连接服务器,端口号默认是22。假如有网络限制22端口通信或者其他什么原因,你可以试试这款工具。

先看看它长什么样子

centos安装web终端-shellinabox_centos

本文以centos为例介绍安装过程

安装epel-release

[root@localhost ~]# yum install epel-release -
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.ustc.edu.cn
 * extras: mirrors.nju.edu.cn
 * updates: mirrors.ustc.edu.cn
base                                                                                                                                                          | 3.6 kB  00:00:00
extras                                                                                                                                                        | 2.9 kB  00:00:00
updates                                                                                                                                                       | 2.9 kB  00:00:00
没有可用软件包 shellinabox。
正在解决依赖关系
--> 正在检查事务
---> 软件包 epel-release.noarch.0.7-11 将被 安装
--> 解决依赖关系完成

依赖关系解决

=====================================================================================================================================================================================
 Package                                         架构                                      版本                                      源                                         大小
=====================================================================================================================================================================================
正在安装:
 epel-release                                    noarch                                    7-11                                      extras                                     15 k

事务概要
=====================================================================================================================================================================================
安装  1 软件包

总下载量:15 k
安装大小:24 k
Downloading packages:
epel-release-7-11.noarch.rpm                                                                                                                                  |  15 kB  00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  正在安装    : epel-release-7-11.noarch                                                                                                                                         1/1
  验证中      : epel-release-7-11.noarch                                                                                                                                         1/1

已安装:
  epel-release.noarch 0:7-11

完毕!

安装shellinabox

[root@localhost ~]# yum install  shellinabox -y
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
epel/x86_64/metalink                                                                                                                                          | 7.3 kB  00:00:00
 * base: mirrors.ustc.edu.cn
 * epel: mirror.nju.edu.cn
 * extras: mirrors.nju.edu.cn
 * updates: mirrors.ustc.edu.cn
epel                                                                                                                                                          | 4.7 kB  00:00:00
epel/x86_64/primary_db         FAILED
https://mirror.01link.hk/epel/7/x86_64/repodata/d526a7fd5dbf31d263829b2d144a41ca6126a8ead6d8a75fe0da87b1f250efb1-primary.sqlite.bz2: [Errno 14] curl#60 - "Peer's Certificate has expired."
正在尝试其它镜像。
It was impossible to connect to the CentOS servers.
This could mean a connectivity issue in your environment, such as the requirement to configure a proxy,
or a transparent proxy that tampers with TLS security, or an incorrect system clock.
You can try to solve this issue by using the instructions on https://wiki.centos.org/yum-errors
If above article doesn't help to resolve this issue please use https://bugs.centos.org/.

(1/3): epel/x86_64/group_gz                                                                                                                                   |  99 kB  00:00:01
(2/3): epel/x86_64/primary_db                                                                                                                                 | 7.0 MB  00:00:22
(3/3): epel/x86_64/updateinfo                                                                                                                                 | 1.0 MB  00:00:23
正在解决依赖关系
--> 正在检查事务
---> 软件包 shellinabox.x86_64.0.2.20-5.el7 将被 安装
--> 解决依赖关系完成

依赖关系解决

=====================================================================================================================================================================================
 Package                                       架构                                     版本                                            源                                      大小
=====================================================================================================================================================================================
正在安装:
 shellinabox                                   x86_64                                   2.20-5.el7                                      epel                                   136 k

事务概要
=====================================================================================================================================================================================
安装  1 软件包

总下载量:136 k
安装大小:503 k
Downloading packages:
警告:/var/cache/yum/x86_64/7/epel/packages/shellinabox-2.20-5.el7.x86_64.rpm: 头V3 RSA/SHA256 Signature, 密钥 ID 352c64e5: NOKEY                  ]  0.0 B/s |    0 B  --:--:-- ETA
shellinabox-2.20-5.el7.x86_64.rpm 的公钥尚未安装
shellinabox-2.20-5.el7.x86_64.rpm                                                                                                                             | 136 kB  00:00:00
从 file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 检索密钥
导入 GPG key 0x352C64E5:
 用户ID     : "Fedora EPEL (7) <epel@fedoraproject.org>"
 指纹       : 91e9 7d7c 4a5e 96f1 7f3e 888f 6a2f aea2 352c 64e5
 软件包     : epel-release-7-11.noarch (@extras)
 来自       : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  正在安装    : shellinabox-2.20-5.el7.x86_64                                                                                                                                    1/1
  验证中      : shellinabox-2.20-5.el7.x86_64                                                                                                                                    1/1

已安装:
  shellinabox.x86_64 0:2.20-5.el7

完毕!

下面命令分别是启动、开放防火墙开放4200端口、设置开机自动启动、查看4200端口状态

# 启动
[root@localhost ~]# service shellinaboxd start
Redirecting to /bin/systemctl start shellinaboxd.service

# 设置开机自动启动
[root@localhost ~]# systemctl enable shellinaboxd
Created symlink from /etc/systemd/system/multi-user.target.wants/shellinaboxd.service to /usr/lib/systemd/system/shellinaboxd.service.
[root@localhost ~]# chkconfig shellinaboxd on
注意:正在将请求转发到“systemctl enable shellinaboxd.service”。

# 开放端口号
[root@localhost ~]# firewall-cmd --zone=public --add-port=4200/tcp --permanent
success
[root@localhost ~]# firewall-cmd --reload
success

# 查看端口使用状态
[root@localhost ~]# lsof -i:4200
COMMAND     PID        USER   FD   TYPE  DEVICE SIZE/OFF NODE NAME
shellinab 15703 shellinabox    4u  IPv4 4934701      0t0  TCP *:4200 (LISTEN)

默认不允许root用户登录,先添加一个其他账号,再使用su命令切换过去

[root@localhost ~]# useradd admin
[root@localhost ~]# passwd admin
更改用户 admin 的密码 。
新的 密码:
无效的密码: 密码未通过字典检查 - 过于简单化/系统化
重新输入新的 密码:
passwd:所有的身份验证令牌已经成功更新。

配置文件,修改端口或其他配置

[root@localhost ~]#  vi /etc/sysconfig/shellinaboxd

https://github.com/shellinabox/shellinabox/ 

https://www.cnblogs.com/DesignerA/p/11625003.html