官方文檔 jumpserver.org/zh/latest/step_by_step.htmlhtml
一、coco是ssh terminal方式(登錄地址: ssh://10.111.232.96:2222),luna是web terminal方式( http://10.111.232.96:5000)。註冊好後,就不會出現上面安裝過程當中的"WARNING"的提示了!python
二、啓動服務器,在後臺運行,加 &mysql
三、用戶是指給運維和開發人員建立的遠程ssh方式登錄堡壘機的帳號,這個不須要真實存在服務器上。有多少人員須要登錄堡壘機就建立多少個這樣的帳號。好比 ssh -p2222 wangshibo@10.111.232.96git
四、管理用戶是指客戶端上的如root等高權限帳號(或普通用戶擁有NOPASSWD: ALL sudo權限), 做用用於推送系統用戶。也就是說這個管理用戶最好使用root,若是是非root帳號,那麼它必須擁有NOPASSWD: ALL sudo權限github
五、系統用戶是真實存在於服務器上的。就是說遠程ssh登錄堡壘機後,會選擇進入哪一個系統用戶下。建立一個系統用戶,若是管理列表裏的機器中沒有,會自動建立。web
1、準備python3.6環境redis
1.1 安裝依賴包sql
$ yum -y install wget sqlite-devel xz gcc automake zlib-devel openssl-devel epel-release數據庫
1.2 編譯安裝vim
$ wget https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tar.xz
$ tar xvf Python-3.6.1.tar.xz && cd Python-3.6.1
$ ./configure && make && make install
1.3 將原來 python 的軟連接重命名:
$ mv /usr/bin/python /usr/bin/python.bak
1.4 將 python 連接至 python3:
$ ln -s /usr/local/bin/python3 /usr/bin/python
1.5 升級 Python 以後,因爲將默認的 python 指向了 python3,yum 不能正常使用,須要修改yum 的配置文件:
$ vim /usr/bin/yum
$ vim /usr/libexec/urlgrabber-ext-down
將 #!/usr/bin/python 改成 #!/usr/bin/python2.7,保存退出便可。
二. 安裝 Jumpserver 0.5.0
2.1 下載
$ cd /opt/
$ git clone --depth=1 https://github.com/jumpserver/jumpserver.git && cd jumpserver && git checkout master
2.2 安裝依賴 RPM 包
$ cd /opt/jumpserver/requirements
$ yum -y install $(cat rpm_requirements.txt)
2.3 安裝 Python 庫依賴
$ pip install -r requirements.txt #
2.4 安裝 Redis, Jumpserver 使用 Redis 作 cache 和 celery broke
$ yum -y install redis
$ service redis start
2.5 建立Jumpserver數據庫並受權
$ mysql
> create database jumpserver default charset 'utf8';
> grant all on jumpserver.* to 'jumpserver'@'127.0.0.1' identified by 'jumpserver';
2.6 修改 Jumpserver 配置文件
$ cd /opt/jumpserver
$ cp config_example.py config.py
$ vi config.py
在class DevelopmentConfig(Config):行下添加以下內容:
DEBUG = True
DB_ENGINE = 'mysql'
DB_HOST = '127.0.0.1'
DB_PORT = 3306
DB_USER = 'jumpserver'
DB_PASSWORD = 'jumpserver'
DB_NAME = 'jumpserver'
2.7 導入數據庫表結構和初始化數據
$ cd /opt/jumpserver/utils
$ bash make_migrations.sh
2.8 運行 Jumpserver
$ cd /opt/jumpserver
$ python run_server.py all
2.9 開機自動運行腳本
#!/bin/bash
#chkconfig:35 80 80
#description:auto_jumpserver
python /opt/jumpserver/run_server.py all
瀏覽器訪問 http://172.16.2.116:8080/
帳號: admin 密碼: admin,
2.9 添加用戶、資產,配置權限等,略。
如圖所示
三. 安裝 SSH Server 和 WebSocket Server: Coco
3.1 新開一個終端,Clone 項目
$ cd /opt
$ git clone https://github.com/jumpserver/coco.git && cd coco && git checkout master
3.2 安裝依賴
$ cd /opt/coco/requirements
$ yum -y install $(cat rpm_requirements.txt)
$ pip install -r requirements.txt
3.3 運行配置文件
$ cd /opt/coco
$ cp conf_example.py conf.py
$ python run_server.py
這時須要在管理後臺-會話管理-終端管理中,接受 Coco 的註冊
3.4 開機啓動腳本
#!/bin/bash
#chkconfig:35 85 85
#description:auto_coco
python /opt/coco/run_server.py
3.4 鏈接
$ ssh -p2222 hanli@172.16.2.116
輸入本身當時重置的密碼:
如圖所示