jumpserver安装

官方文档 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

输入本身当时重置的密码: 

如图所示

相关文章
相关标签/搜索