1、jumpserver安装

1.1、环境介绍

系统: CentOS 7.4.1708
IP: 192.168.56.110

[root@linux-node1 ~]# uname -r
3.10.-.el7.x86_64
[root@linux-node1 ~]# cat /etc/redhat-release
CentOS Linux release 7.4. (Core)

1.2、关闭 selinux 和防火墙

[root@linux-node1 ~]# setenforce   # 可以设置配置文件永久关闭
[root@linux-node1 ~]# systemctl stop firewalld.service
[root@linux-node1 ~]# systemctl disable firewalld.service
[root@linux-node1 ~]# iptables -F
[root@linux-node1 ~]# iptables-save

1.3、准备 Python3 和 Python 虚拟环境

()安装依赖包
[root@linux-node1 ~]# yum -y install wget sqlite-devel xz gcc automake zlib-devel openssl-devel epel-release git ()编译安装pyhton3.6.1
[root@linux-node1 ~]# wget https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tar.xz
[root@linux-node1 ~]# tar xvf Python-3.6..tar.xz && cd Python-3.6.
[root@linux-node1 ~]# ./configure && make && make install ()建立 Python 虚拟环境 因为 CentOS / 自带的是 Python2,而 Yum 等工具依赖原来的 Python,为了不扰乱原来的环境我们来使用 Python 虚拟环境 [root@linux-node1 ~]# cd /opt
[root@linux-node1 ~]# python3 -m venv py3
[root@linux-node1 ~]# source /opt/py3/bin/activate # 看到下面的提示符代表成功,以后运行 Jumpserver 都要先运行以上 source 命令,以下所有命令均在该虚拟环境中运行
(py3) [root@linux-node1 ~]#

1.4、 安装 Jumpserver 1.0.0

()下载或 Clone 项目

项目提交较多 git clone 时较大,你可以选择去 Github 项目页面直接下载zip包。

[root@linux-node1 ~]# cd /opt/
[root@linux-node1 ~]# git clone --depth= https://github.com/jumpserver/jumpserver.git && cd jumpserver && git checkout master () 安装依赖 RPM 包 [root@linux-node1 ~]# cd /opt/jumpserver/requirements
[root@linux-node1 ~]# yum -y install $(cat rpm_requirements.txt) # 如果没有任何报错请继续 ()安装 Python 库依赖
[root@linux-node1 ~]# pip install -r requirements.txt # 不要指定-i参数,因为镜像上可能没有最新的包,如果没有任何报错请继续 ()安装 Redis, Jumpserver 使用 Redis 做 cache 和 celery broke
[root@linux-node1 ~]# yum -y install redis
[root@linux-node1 ~]# systemctl start redis ()安装 MySQL
[root@linux-node1 ~]# yum -y install mariadb mariadb-devel mariadb-server
[root@linux-node1 ~]# systemctl start mariadb ()创建数据库 Jumpserver 并授权
[root@linux-node1 ~]# mysql
> create database jumpserver default charset 'utf8';
> grant all on jumpserver.* to 'jumpserver'@'127.0.0.1' identified by 'jumpserver'; ()修改 Jumpserver 配置文件 [root@linux-node1 ~]# cd /opt/jumpserver
[root@linux-node1 jumpserver]# cp config_example.py config.py
[root@linux-node1 ~]# vim config.py # 我们计划修改 DevelopmentConfig中的配置,因为默认jumpserver是使用该配置,它继承自Config
注意: 配置文件是 Python 格式,不要用 TAB,而要用空格 class DevelopmentConfig(Config):
DEBUG = True
DB_ENGINE = 'mysql'
DB_HOST = '127.0.0.1'
DB_PORT =
DB_USER = 'jumpserver'
DB_PASSWORD = 'somepassword'
DB_NAME = 'jumpserver'
... config = DevelopmentConfig() # 确保使用的是刚才设置的配置文件 ()生成数据库表结构和初始化数据 [root@linux-node1 ~]# cd /opt/jumpserver/utils
[root@linux-node1 ~]# bash make_migrations.sh () 运行 Jumpserver [root@linux-node1 ~]# cd /opt/jumpserver
[root@linux-node1 ~]# python run_server.py all
运行不报错,请浏览器访问 http://192.168.56.110:8080/ (这里只是 Jumpserver, 没有 Web Terminal,所以访问 Web Terminal 会报错) 账号: admin 密码: admin

1.5、安装 SSH Server 和 WebSocket Server: Coco

()下载或 Clone 项目

新开一个终端,连接测试机,别忘了 source /opt/py3/bin/activate

$ cd /opt
$ git clone https://github.com/jumpserver/coco.git && cd coco && git checkout master ()安装依赖 $ cd /opt/coco/requirements
$ yum -y install $(cat rpm_requirements.txt)
$ pip install -r requirements.txt ()查看配置文件并运行 $ cd /opt/coco
$ cp conf_example.py conf.py
$ python run_server.py
这时需要去 Jumpserver 管理后台-会话管理-终端管理(http://192.168.56.110:8080/terminal/terminal/)接受 Coco 的注册 Coco version 0.4., more see https://www.jumpserver.org
Starting ssh server at 0.0.0.0:
Quit the server with CONTROL-C.

1.6、测试连接

#命令行远程连接跳板机
[root@linux-node1 ~]# ssh -p2222 admin@192.168.56.110
The authenticity of host '[192.168.56.110]:2222 ([192.168.56.110]:2222)' can't be established.
RSA key fingerprint is SHA256:+OT2q1lPHGXKkfKOeZiNaoHx5LPMBAa48MWsmqwaHKE.
RSA key fingerprint is MD5:3c::c3::ca::f9:c0:3e::dc:d9:b0::1a:7f.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '[192.168.56.110]:2222' (RSA) to the list of known hosts.
admin@192.168.56.110's password: 密码: admin
如图所示:

如果是用在 Windows 下,Xshell Terminal 登录语法如下
$ssh admin@192.168.56.110 2222
密码: admin
如果能登陆代表部署成功

1.7、安装 Web Terminal 前端: Luna

Luna 已改为纯前端,需要 Nginx 来运行访问
访问(https://github.com/jumpserver/luna/releases)下载对应版本的 release 包,直接解压,不需要编译

()解压 Luna

[root@linux-node1 ~]# pwd
/opt/ [root@linux-node1 ~]# tar xvf luna.tar.gz
[root@linux-node1 ~]# ls /opt/luna

1.8、 配置 Nginx 整合各组件

()安装 Nginx 根据喜好选择安装方式和版本
[root@linux-node1 ~]# yum -y install nginx ()准备配置文件 修改 /etc/nginx/nginx.conf [root@linux-node1 conf.d]# cat /etc/nginx/nginx.conf
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid; # Load dynamic modules. See /usr/share/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf; events {
worker_connections 1024;
} http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048; include /etc/nginx/mime.types;
default_type application/octet-stream; # Load modular configuration files from the /etc/nginx/conf.d directory.
# See http://nginx.org/en/docs/ngx_core_module.html#include
# for more information.
include /etc/nginx/conf.d/*.conf;
server {
listen 80; proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; location /luna/ {
try_files $uri / /index.html;
alias /opt/luna/;
} location /media/ {
add_header Content-Encoding gzip;
root /opt/jumpserver/data/;
} location /static/ {
root /opt/jumpserver/data/;
} location /socket.io/ {
proxy_pass http://localhost:5000/socket.io/;
proxy_buffering off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
} location /guacamole/ {
proxy_pass http://localhost:8081/;
proxy_buffering off;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
access_log off;
} location / {
proxy_pass http://localhost:8080;
}
}
} (3)运行 Nginx
[root@linux-node1 ~]# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
[root@linux-node1 ~]# systemctl reload nginx (4)访问 http://192.168.56.110,如图:

官方文档:http://docs.jumpserver.org/zh/docs/introduce.html

Jumpserver跳板机入门的更多相关文章

  1. Linux系统——JumpServer跳板机的搭建和部署

    公网源部署jumpserver跳板机 建立阿里云公网源yum仓库(服务端)[root@localhost ~]# lsanaconda-ks.cfg install.log.syslog jumpse ...

  2. 其他综合-CentOS7 安装 Jumpserver 跳板机

    CentOS7 安装 Jumpserver 跳板机 1.实验描述 搭建 jumpserver 平台,实现有效的运维安全审计.完美做到事先防范,事中控制和事后溯源 2.实验环境 物理机系统:Window ...

  3. jumpserver跳板机(堡垒机)安装

     jumpserver跳板机(堡垒机) Jumpserver 是一款由Python编写开源的跳板机(堡垒机)系统,实现了跳板机应有的功能,基于ssh协议来管理,客户端无需安装agent,助力互联网企业 ...

  4. linux Jumpserver跳板机 /堡垒机详细部署

    关于跳板机/堡垒机的介绍: 跳板机的定义: 跳板机就是一台服务器,开发或运维人员在维护过程中首先要统一登录到这台服务器,然后再登录到目标设备进行维护和操作: 跳板机缺点: 没有实现对运维人员操作行为的 ...

  5. JumpServer 跳板机系统

    Jumpserver项目为开源项目,截至到目前最新版本为4.0,4.0功能并不完整,无上传.下载功能,配置复杂.启动服务也较繁琐,推荐使用0.3.2版本,文档较全,安装简单文档链接https://gi ...

  6. CentOS 7 搭建Jumpserver跳板机(堡垒机)

    跳板机概述: 跳板机就是一台服务器,开发或运维人员在维护过程中首先要统一登录到这台服务器,然后再登录到目标设备进行维护和操作 跳板机缺点:没有实现对运维人员操作行为的控制和审计,使用跳板机的过程中还是 ...

  7. Jumpserver跳板机的搭建和部署

    1.需要搭云yum仓库wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo 2. ...

  8. jumpserver跳板机的搭建

    搭建的跳板机基于0.3.2,别问我为什么不用0.5版本的,我能说我没有搭建成功么,步骤贼多,功能不完善,不建议生产环境使用 步骤其实很简单: github wiki :https://github.c ...

  9. jumpserver跳板机搭建,适合centos6和centos7的使用

    第17章 jumpserver的搭建   17.1 jumpserver的介绍 jumpserver是全球首款开源的堡垒机,使用的是GNU,GPL的开源协议. jumpserver是用python和g ...

随机推荐

  1. cocos2d-x3.0 后配置信息重置

    原文地址:http://blog.csdn.net/qqmcy/article/details/37722689 近期遇到这种一个问题,cocos设置setup.py中ndk.sdk.ant时设置的路 ...

  2. Java并发案例03---生产者消费者问题02

    生产者消费者第二种情形 package com.maple.msb.one; public class ProducerConsumer { public static void main(Strin ...

  3. 使用Azcopy在Azure上进行HBase的冷热备份还原

    场景 HBase表TaskLog中有20.55G数据(20553078551Byte),目前存放在热存储中,现在要移至冷热储,并进行还原. HBase目录:hbase/data/default 冷目录 ...

  4. Win7电脑无法安全删除硬件并弹出媒体的解决方法

    有很多用户经常会在win7系统中使用移动硬盘或U盘来拷贝数据,而当使用完了之后,一般为了数据能够更安全,都会右击选择安全删除硬件进行退出,可是有win7系统用户却发现要弹出设备的还好无法安全删除硬件并 ...

  5. PHPStorm配置xdebug(phpStudy/wamp)

    一.下载并配置XDebug wamp环境: 1.获取xdebug

  6. 定义一个类Point,代表一个点,public属性有x和y,方法有显示点坐标 show(),构造函数有两个参数分别给x,y赋值,在main方法中构造两个对象,再创建一方法(getMiddle)为取两个点构成线段的中点的坐标,参数为2个点对象,调用此方法后得到一个新的点,编写Application,显示该对象的坐标值。

    这个题让我更加明白了类创建对象的实质 代码中用到:1.对象作形参;2.对象作返回值 以下用代码具体分析: class Point1{ public double x; public double y; ...

  7. SDWebImage的一些简单使用

    SDWebImage是一个三方类库, 所以要使用它首先要把它引入我们的工程, 其托管在github上: https://github.com/rs/SDWebImage 有几种引入的方法, 一种是直接 ...

  8. LWIP network interface 即 LWIP 的 硬件 数据 接口 移植 详解 STM32 以太网数据 到达 的第二站: void ethernetif_input( void * pvParameters )

    根据 上一篇 文章 , ETH  DMA 数据中断 会 发送 一个信号量 ,我使用 全局 搜索 这个信号量 s_xSemaphore 得到 一下 几个 值 根据 这个 分析  我们找到了   数据 的 ...

  9. 【学时总结】 ◆学时 · I◆ A*算法

    [学时·I]A*算法 ■基本策略■ --A*(A Star)无非就是BFS的升级,当BFS都超时的时候-- 同样以队列为基础结构,BFS使用FIFO队列(queue),而A*则使用优先队列(prior ...

  10. pyntho经典面试题

    Python基础篇 1:为什么学习Python 2:通过什么途径学习Python 3:谈谈对Python和其他语言的区别 Python的优势: 4:简述解释型和编译型编程语言 5:Python的解释器 ...