真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

一站式部署Jumpserver

博文大綱:
一、Jumpserver簡介
二、安裝Jumpserver準備環(huán)境
三、配置Python 3環(huán)境
四、安裝Jumpserver
五、安裝mariadb、redis并配置jumpserver
六、安裝coco組件并配置
七、安裝guacamole及l(fā)una
八、安裝nginx
九、客戶端訪問測試

新會網(wǎng)站建設(shè)公司成都創(chuàng)新互聯(lián),新會網(wǎng)站設(shè)計制作,有大型網(wǎng)站制作公司豐富經(jīng)驗。已為新會近1000家提供企業(yè)網(wǎng)站建設(shè)服務(wù)。企業(yè)網(wǎng)站搭建\成都外貿(mào)網(wǎng)站建設(shè)公司要多少錢,請找那個售后服務(wù)好的新會做網(wǎng)站的公司定做!

一、Jumpserver簡介

Jumpserver是全球首款完全開源的堡壘機,使用GNU GPL v2.0開源協(xié)議,是符合4A的專業(yè)運維審計系統(tǒng)。

Jumpserver 使用 Python / Django 進行開發(fā), 遵循 Web 2.0 規(guī)范, 配備了業(yè)界領(lǐng)先的 Web Terminal 解決方案, 交互界面美觀、用戶體驗好。

Jumpserver 采納分布式架構(gòu), 支持多機房跨區(qū)域部署, 中心節(jié)點提供 API, 各機房部署登錄節(jié)點, 可橫向擴展、無并發(fā)訪問限制。

Jumpserver 現(xiàn)已支持管理 SSH、 Telnet、 RDP、 VNC 協(xié)議資產(chǎn)。

Jumpserver的特點:

  • 完全開源;
  • Python編寫,易于二次開發(fā);
  • 實現(xiàn)跳板機的基本功能、認證、授權(quán)、審計;
  • 集成了Ansiable,實現(xiàn)批量操作命令等;
  • 支持web終端;
  • Bootstrap編寫,界面美觀;
  • 自動收集硬件信息;
  • 錄像回放、命令搜索、實時監(jiān)控;

二、安裝Jumpserver準備環(huán)境

下載所需軟件包

(1)安裝環(huán)境要求

  • 硬件配置:2個CPU核心、4G內(nèi)存、50G硬盤(最低);
  • 操作系統(tǒng):Linux 發(fā)行版 x86_64;
  • python環(huán)境3.6.x以上;
  • 數(shù)據(jù)庫:msyq或者mariadb,l版本必須是5.6以上;
  • Redis;

(2)Jumpserver的相關(guān)組件

  • Jumpserver:管理后臺,管理員可以通過Web頁面進行資產(chǎn)管理、用戶管理、資產(chǎn)授權(quán)等操作;用戶可以通過Web頁面進行資產(chǎn)登錄、文件管理等操作;
  • koko:提供SSH Server 和 Web Terminal Server 。用戶可以使用自己的賬戶通過 SSH 或者 Web Terminal 訪問 SSH 協(xié)議和 Telnet 協(xié)議資產(chǎn);
  • Luna:提供Web Terminal Server前端頁面,用戶使用Web Termina方式登錄所需組件;
  • Guacamole:為 RDP 協(xié)議和 VNC 協(xié)議資產(chǎn)組件, 用戶可以通過 Web Terminal 來連接 RDP 協(xié)議和 VNC 協(xié)議資產(chǎn)(常用于windows服務(wù)器);

(3)相關(guān)組件端口、配置文件說明

如圖:
一站式部署Jumpserver

  • Jumpserver默認Web端口為8080/tcp、默認WS端口為8070/tcp;配置文件為jumpserver/config.yml;
  • koko默認SSH端口為2222/tcp、默認為Web Terninal端口為5000/tcp;配置文件為koko/config.yml;
  • Guacamole默認端口為 8081/tcp; 配置文件為/config/tomcat9/conf/server.xml
  • Nginx默認端口為 80/tcp;
  • Redis默認端口為 6379/tcp;
  • MySQL/mariadb默認端口為 3306/tcp;
(4)使系統(tǒng)支持中文環(huán)境
[root@jumpserver ~]# localedef -c -f UTF-8 -i  zh_CN  zh_CN.UTF-8
[root@jumpserver ~]# export LC_ALL=zh_CN.UTF-8
[root@jumpserver ~]#  echo 'LC_ALL=zh_CN.UTF-8' > /etc/locale.conf 

三、配置Python 3環(huán)境

[root@jumpserver ~]# yum -y install wget sqlite-devel xz gcc automake zlib-devel openssl-devel epel-release git
//下載所需依賴
[root@jumpserver ~]# tar xf Python-3.6.1.tar.xz -C /usr/src
[root@jumpserver ~]# cd /usr/src/Python-3.6.1/
[root@jumpserver Python-3.6.1]# ./configure && make && make install
//編譯安裝python 3環(huán)境
[root@jumpserver Python-3.6.1]# cd /opt
[root@jumpserver opt]#  python3 -m venv py3
[root@jumpserver opt]#  source /opt/py3/bin/activate
(py3) [root@jumpserver opt]# 
//出現(xiàn)這樣的字符表示在python 3虛擬環(huán)境成功
(py3) [root@jumpserver opt]# unzip autoenv.zip 
 (py3) [root@jumpserver opt]#  echo "source /opt/autoenv/activate.sh" >> /root/.bashrc
 (py3) [root@jumpserver opt]# source /root/.bashrc
//使用autoenv設(shè)置為自動載入python 3的虛擬環(huán)境

四、安裝Jumpserver

(py3) [root@jumpserver opt]# unzip jumpserver.zip 
(py3) [root@jumpserver opt]# echo "source /opt/py3/bin/activate" > /opt/jumpserver/.env
(py3) [root@jumpserver opt]# cd jumpserver/
autoenv:
autoenv: WARNING:
autoenv: This is the first time you are about to source /opt/jumpserver/.env:
autoenv:
autoenv:   --- (begin contents) ---------------------------------------
autoenv:     source /opt/py3/bin/activate$
autoenv:
autoenv:   --- (end contents) -----------------------------------------
autoenv:
autoenv: Are you sure you want to allow this? (y/N) y       //輸入“y”表示自動載入python3環(huán)境
(py3) [root@jumpserver jumpserver]# cd requirements/
(py3) [root@jumpserver requirements]# yum -y install $(cat rpm_requirements.txt)
//安裝所需依賴
(py3) [root@jumpserver requirements]# pip install --upgrade pip
(py3) [root@jumpserver requirements]# pip install wheel
(py3) [root@jumpserver requirements]# pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/
//安裝python所需依賴

五、安裝mariadb、redis并配置jumpserver

安裝mariadb

(py3) [root@jumpserver requirements]#  yum -y install mariadb mariadb-devel mariadb-server 
(py3) [root@jumpserver requirements]# systemctl start mariadb
(py3) [root@jumpserver requirements]# mysqladmin -u root password 123.com
(py3) [root@jumpserver requirements]# mysql -u root -p123.com
MariaDB [(none)]> create database jumpserver default charset 'utf8' ;
MariaDB [(none)]> grant all on jumpserver.* to jumpserver@127.0.0.1 identified by '123.com';
MariaDB [(none)]>  flush privileges;
(py3) [root@jumpserver requirements]# ss -lnt | grep 3306
LISTEN     0      50           *:3306                     *:*                  

安裝redis

(py3) [root@jumpserver requirements]# yum -y install redis
(py3) [root@jumpserver requirements]# systemctl start redis
(py3) [root@jumpserver requirements]# ss -lnt | grep 6379
LISTEN     0      128    127.0.0.1:6379                     *:*                  

配置jumpserver

(py3) [root@jumpserver ~]# cd /opt/jumpserver/
(py3) [root@jumpserver jumpserver]# cp config_example.yml config.yml 
#生成秘鑰令牌
(py3) [root@jumpserver jumpserver]# SECRET_KEY=`cat /dev/urandom | tr -dc A-Za-z0-9 | head -c 50`
(py3) [root@jumpserver jumpserver]# echo "SECRET_KEY=$SECRET_KEY" >> ~/.bashrc
(py3) [root@jumpserver jumpserver]# BOOTSTRAP_TOKEN=`cat /dev/urandom | tr -dc A-Za-z0-9 | head -c 16`
(py3) [root@jumpserver jumpserver]# echo "BOOTSTRAP_TOKEN=$BOOTSTRAP_TOKEN" >> ~/.bashrc
(py3) [root@jumpserver jumpserver]# sed -i "s/SECRET_KEY:/SECRET_KEY: $SECRET_KEY/g" /opt/jumpserver/config.yml
(py3) [root@jumpserver jumpserver]# sed -i "s/BOOTSTRAP_TOKEN:/BOOTSTRAP_TOKEN: $BOOTSTRAP_TOKEN/g" /opt/jumpserver/config.yml
(py3) [root@jumpserver jumpserver]# sed -i "s/# DEBUG: true/DEBUG: false/g" /opt/jumpserver/config.yml
(py3) [root@jumpserver jumpserver]# sed -i "s/# LOG_LEVEL: DEBUG/LOG_LEVEL: ERROR/g" /opt/jumpserver/config.yml
(py3) [root@jumpserver jumpserver]# sed -i "s/# SESSION_EXPIRE_AT_BROWSER_CLOSE: False/SESSION_EXPIRE_AT_BROWSER_CLOSE: true/g" /opt/jumpserver/config.yml 
(py3) [root@jumpserver jumpserver]# sed -i "s/DB_PASSWORD: /DB_PASSWORD: 123.com/g" /opt/jumpserver/config.yml
(py3) [root@jumpserver jumpserver]# echo -e "\033[31m 你的SECRET_KEY是 $SECRET_KEY \033[0m"
 你的SECRET_KEY是 UmIWcyEGJN6JfCbCYnthtlK7z4wQ8HwlEL2DagdBxPJjWWRdSN 
(py3) [root@jumpserver jumpserver]# echo -e "\033[31m 你的BOOTSTRAP_TOKEN是 $BOOTSTRAP_TOKEN \033[0m"
 你的BOOTSTRAP_TOKEN是 qFs86ALWXpamrBaH 
(py3) [root@jumpserver jumpserver]# egrep -v '^$|^#' config.yml 
SECRET_KEY: UmIWcyEGJN6JfCbCYnthtlK7z4wQ8HwlEL2DagdBxPJjWWRdSN
BOOTSTRAP_TOKEN: qFs86ALWXpamrBaH
DEBUG: false
LOG_LEVEL: ERROR
DB_ENGINE: mysql
DB_HOST: 127.0.0.1
DB_PORT: 3306
DB_USER: jumpserver
DB_PASSWORD: 123.com
DB_NAME: jumpserver
HTTP_BIND_HOST: 0.0.0.0
HTTP_LISTEN_PORT: 8080
REDIS_HOST: 127.0.0.1
REDIS_PORT: 6379
(py3) [root@jumpserver jumpserver]# ./jms start all -d
(py3) [root@jumpserver jumpserver]# ss -lnt | grep 8080
LISTEN     0      128          *:8080                     *:*                  

六、安裝coco組件并配置

(py3) [root@jumpserver opt]# unzip coco.zip 
(py3) [root@jumpserver opt]# cd coco
(py3) [root@jumpserver coco]# echo "source /opt/py3/bin/activate" > /opt/coco/.env
(py3) [root@jumpserver coco]# cd requirements/
autoenv:
autoenv: WARNING:
autoenv: This is the first time you are about to source /opt/coco/.env:
autoenv:
autoenv:   --- (begin contents) ---------------------------------------
autoenv:     source /opt/py3/bin/activate$
autoenv:
autoenv:   --- (end contents) -----------------------------------------
autoenv:
autoenv: Are you sure you want to allow this? (y/N) y
(py3) [root@jumpserver requirements]# yum -y install $(cat rpm_requirements.txt)
(py3) [root@jumpserver requirements]# pip install -r requirements.txt
(py3) [root@jumpserver requirements]# cd ..
(py3) [root@jumpserver coco]# cp config_example.yml config.yml 
(py3) [root@jumpserver coco]# echo -e "\033[31m 你的BOOTSTRAP_TOKEN是 $BOOTSTRAP_TOKEN \033[0m"
 你的BOOTSTRAP_TOKEN是 qFs86ALWXpamrBaH 
(py3) [root@jumpserver coco]# sed -i "s/BOOTSTRAP_TOKEN: /BOOTSTRAP_TOKEN:  $BOOTSTRAP_TOKEN/g" config.yml
(py3) [root@jumpserver coco]# sed -i "s/# LOG_LEVEL: INFO/LOG_LEVEL: ERROR/g" config.yml 
(py3) [root@jumpserver coco]#  egrep -v '^$|^#' config.yml 
CORE_HOST: http://127.0.0.1:8080
BOOTSTRAP_TOKEN: qFs86ALWXpamrBaH
//注意保證16個隨機字符保證與jumpserver配置文件中的16個隨機字符保證一致
LOG_LEVEL: ERROR
(py3) [root@jumpserver coco]# ./cocod start -d
(py3) [root@jumpserver coco]# ss -lnt | grep 2222
LISTEN     0      5            *:2222                     *:*                  

七、安裝guacamole及l(fā)una

(py3) [root@jumpserver ~]# yum install -y yum-utils device-mapper-persistent-data lvm2
(py3) [root@jumpserver ~]# yum-config-manager  --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
(py3) [root@jumpserver ~]#  yum makecache fast
(py3) [root@jumpserver ~]# yum -y install docker-ce
(py3) [root@jumpserver ~]# systemctl start docker
(py3) [root@jumpserver ~]# docker load < guacamole.tar 
(py3) [root@jumpserver ~]# docker run --name jms_guacamole -d \
 -p 8081:8080 -v /opt/guacamole/key:/config/guacamole/key \
 -e JUMPSERVER_KEY_DIR=/config/guacamole/key \
 -e JUMPSERVER_SERVER=http://192.168.1.10:8080 \
 jumpserver/guacamole:latest
(py3) [root@jumpserver ~]# ss -lnt | grep 8081
LISTEN     0      128         :::8081                    :::*                  
(py3) [root@jumpserver ~]# tar zxf luna.tar.gz -C /opt

八、安裝nginx

(py3) [root@jumpserver ~]# tar zxf nginx-1.2.4.tar.gz -C /usr/src
(py3) [root@jumpserver ~]# cd /usr/src/nginx-1.2.4/
(py3) [root@jumpserver nginx-1.2.4]# ./configure && make && make install
(py3) [root@jumpserver nginx-1.2.4]# ln -sf /usr/local/nginx/sbin/nginx /usr/local/bin/
(py3) [root@jumpserver nginx-1.2.4]# cd /usr/local/nginx/conf/
(py3) [root@jumpserver conf]# cp nginx.conf nginx.conf.bak
(py3) [root@jumpserver conf]# mv /root/nginx.conf .
mv:是否覆蓋"./nginx.conf"? y
(py3) [root@jumpserver conf]# nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
(py3) [root@jumpserver conf]# nginx
(py3) [root@jumpserver conf]# ss -lnt | grep -w 80
LISTEN     0      128          *:80                       *:*                  

九、客戶端訪問測試

如圖:
一站式部署Jumpserver

(1)創(chuàng)建普通用戶

此用戶用于登錄Jumpserver web頁面的用戶,創(chuàng)建過程如下:

一站式部署Jumpserver
一站式部署Jumpserver

(2)創(chuàng)建管理用戶

此用戶主要用于管理后端資源,創(chuàng)建方法如下:
一站式部署Jumpserver
一站式部署Jumpserver

(3)創(chuàng)建系統(tǒng)用戶

此用戶主要用于登錄后端資產(chǎn),創(chuàng)建方法如下:
一站式部署Jumpserver
一站式部署Jumpserver

(4)創(chuàng)建后端資產(chǎn)

實驗環(huán)境,所以就開啟一臺虛擬機192.168.1.1作為測試(web頁面的客戶端與后端資產(chǎn)肯定不在同一網(wǎng)段,因為用戶是通過公網(wǎng)登錄到j(luò)umpserver才可以對后端服務(wù)器進行操作的)!

一站式部署Jumpserver
一站式部署Jumpserver

(5)創(chuàng)建授權(quán)規(guī)則

一站式部署Jumpserver
一站式部署Jumpserver

(6)連接后端資產(chǎn)

一站式部署Jumpserver
一站式部署Jumpserver

最后,雖然寫文檔花費了不少時間,但是還是建議大家參考Jumpserver官方文檔

————————————本文到此結(jié)束,感謝閱讀——————————————


當(dāng)前名稱:一站式部署Jumpserver
本文URL:http://weahome.cn/article/goecij.html

其他資訊

在線咨詢

微信咨詢

電話咨詢

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部