zoukankan      html  css  js  c++  java
  • 主机管理+堡垒机系统开发: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

  • 相关阅读:
    Ubuntu 安装 JDK 7 / JDK8 的两种方式
    python 深拷贝 浅拷贝 赋值
    importlib.import_module
    pandas分块读取大量数据集
    win10下安装XGBoost Gpu版本
    win10下安装LGBM GPU版本
    统计自然语言处理(第二版)笔记1
    K-近邻算法
    2019考研的一些心得
    lib和dll的区别与使用
  • 原文地址:https://www.cnblogs.com/luoahong/p/9499840.html
Copyright © 2011-2022 走看看