主机管理+堡垒机系统开发:webssh(十)

一、安装shellinabox

1、安装依赖工具

yum install git openssl-devel pam-devel zlib-devel autoconf automake libtool

2、克隆代码

git clone https://github.com/shellinabox/shellinabox.git && cd shellinabox

3、生成configure 

autoreconf -i

4、编译安装

./configure --prefix=/opt/shellinabox
make install
echo $?

5、启动

cd bin/
./shellinabox -t

6、检查端口是否启动

netstat -ntplu 
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:4200            0.0.0.0:*               LISTEN      12131/./shellinabox 

二、shellinabox web登陆截图

1、web登陆

2、堡垒机

3、192.168.16.51执行df和pwd命令

5、192.168.16.51执行top命令

三、嵌入到堡垒机项目

1、views

@login_required
def webssh(request):
    return render(request,'web_ssh.html')

2、web_ssh.html

{% extends 'index.html' %}


{% block page-title %}WEB SSH{% endblock %}

{% block page-content %}
<div class="panel">
    <div class="panel-heading">
        <h3 class="panel-title">webssh</h3>
    </div>
    <div class="panel-body">
        <ul>
            <a  class="btn-link" href="http://192.168.16.52:4200/">web ssh </a>
        </ul>
    </div>
</div>
{% endblock %}

四、测试截图

 1、后台登陆

2、连接具webssh

 

转载于:https://www.cnblogs.com/luoahong/p/9499840.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值