主機管理+堡壘機系統開發:審計回顧(八)

1、建立用戶並受權

一、建立用戶、設置密碼html

[root@localhost CrazyEye]useradd  audit
[root@localhost CrazyEye]# passwd audit
Changing password for user audit.
New password: 
BAD PASSWORD: The password is shorter than 8 characters
Retype new password: 
passwd: all authentication tokens updated successfully.

二、sudoers受權python

$cat /etc/sudoers
%crazy_audit    ALL=NOPASSWD:ALL #/usr/bin/strace,/usr/bin/python3

三、給文件夾受權django

chown -R audit.audit /opt/CrazyEye/

2、安裝必要工具

一、安裝sshpassbootstrap

curl -O -L http://downloads.sourceforge.net/project/sshpass/sshpass/1.06/sshpass-1.06.tar.gz 
tar xvzf sshpass-1.06.tar.gz 
cd sshpass-1.06
./configure
make && sudo make install

二、安裝djangobash

[root@localhost CrazyEye]# su audit
[audit@localhost CrazyEye]$ pwd
/usr/local/Python-3.5.3/bin
./pip3  install --upgrade pip
./pip3 install django -i http://pypi.douban.com/simple --trusted-host pypi.douban.com

三、後臺受權機器ssh

3、實戰測試

一、啓動程序

[audit@localhost CrazyEye]$ pwd
/opt/CrazyEye
[audit@localhost CrazyEye]$ python manage.py runserver 0.0.0.0:9000

二、登錄截圖

一、登錄堡壘機curl

二、鏈接到目標主機工具

三、目標主機操做命令測試

三、部分日誌展現

4、nifty模板介紹

一、引子

一、模板選擇的網站網站

https://wrapbootstrap.com/theme/nifty-light-dark-admin-template-WB0048JF7

二、國內的有名的是模板堂

https://www.ecmoban.com/

三、nifty和bootstrap比較

一、扁平化
二、有不少組件

二、nifty部分功能截圖

一、首頁

二、側邊框

三、Form表單

四、Widgets1

五、Buttons

六、ui-alerts-tooltips.html

相關文章
相關標籤/搜索