1. 程式人生 > >Jumpserver v0.4.0 版本安裝詳細過程

Jumpserver v0.4.0 版本安裝詳細過程

sqlite3

環境

  • 系統: CentOS 6.5 x86_64 mini

  • Python: 版本 3.6 大部分功能兼容 2.7

  • 安裝目錄

    • /opt/jumpserver

    • /opt/coco

一. 環境準備

1.1 安裝基本工具和庫
$ yum -y install sqlite-devel git epel-release
$ yum -y install sshpass python-devel libffi-devel openssl-devel
$ yum -y install gcc gcc-c++
1.2 安裝Python 3.6 和 Django

二. Jumpserver安裝

2.1 下載倉庫代碼
$ cd /opt
$ git clone https://github.com/jumpserver/jumpserver.git
$ cd jumpserver
$ git checkout dev
2.2 安裝依賴
$ cd requirements 
$ sudo yum -y install `cat rpm_requirements.txt`
$ pip install -r requirements.txt -i https://pypi.doubanio.com/simple
2.3 準備配置文件
$ cd ..
$ cp config_example.py config.py
$ vim config.py

// 默認使用的是 DevelpmentConfig 所以應該去修改這部分
class DevelopmentConfig(Config):
EMAIL_HOST = ‘smtp.exmail.qq.com‘
EMAIL_PORT = 465
EMAIL_HOST_USER = [email protected]
/* */ EMAIL_HOST_PASSWORD = ‘xxx‘ EMAIL_USE_SSL = True // 端口是 465 設置 True 否則 False EMAIL_USE_TLS = False // 端口是 587 設置為 True 否則 False SITE_URL = ‘http://localhost:8080‘ // 發送郵件會使用這個地址
2.4 初始化數據庫
$ cd utils
$ sh make_migrations.sh
$ sh init_db.sh
2.5 安裝redis server
$ yum -y install redis
$ service redis start

2.6 啟動

$ cd ..
$ python run_server.py

訪問 http://ip:8080 賬號密碼: admin admin

2.7 測試使用

  • 創建用戶
    會發送郵件,測試是否正常修改密碼,登錄

  • 創建管理用戶 創建一個管理用戶, 創建資產時需要關聯

  • 創建資產 創建一個 資產,關聯剛創建的管理用戶

  • 創建系統用戶 系統用戶是用來登錄資產的,授權時需要

  • 創建授權規則 關聯用戶,資產,系統用戶 形成授權規則,授權的系統用戶會自動推送到資產上

三. 安裝 SSH SERVER - COCO

3.1 下載代碼庫

$ cd /opt
$ git clone https://github.com/jumpserver/coco.git

3.2 安裝依賴

$ cd coco/requirements
$ pip install -r requirements.txt  # -i https://pypi.doubanio.com/simple

3.3 啟動

$ cd ..
$ python run_server.py

說明: Coco啟動後會向jumpserver註冊,請去 jumpserver頁面 - 應用程序 - terminal - coco - Accept 允許, 這時 coco就 運行在 2222端口,可以ssh來連接

命令行:

ssh [email protected] -p2222

3.5 測試

  • 測試登錄 ssh server

  • 測試跳轉

  • 測試命令記錄回


四. 安裝 SSH SERVER - Luna

Luna 是Jumpserver項目的web terminal子項目, 用戶登陸 Luna可以獲取擁有權限 資產列表, 登錄資產,並記錄日誌等

Quick start

$ git clone https://github.com/jumpserver/luna.git
                                                                                                                      $ brew install $(cat mac_requirements.txt)
$ pip install --user -r requirements.txt -i https://pypi.douban.com/simple

$ export JUMPSERVER_ENDPOINT=‘http://a-jumpserver-url:port‘
  # 或修改配置文件設置 JUMPSERVER_ENDPOINT 
  
$ python run_server.py

如果不想和Jumpserver聯調,修改 run_server.py

# 註釋掉
# app.bootstrap()


報錯:
django.core.exceptions.ImproperlyConfigured: Error loading either pysqlite2 or sqlite3 modules (tried in that order): No module named ‘_sqlite3‘


解決方法見:http://qiangsh.blog.51cto.com/3510397/1939100

本文出自 “奔跑在路上” 博客,請務必保留此出處http://qiangsh.blog.51cto.com/3510397/1939107

Jumpserver v0.4.0 版本安裝詳細過程