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