堡垒机-jumpserver

Jumpserver 软件包环境要求:

Python = 3.6.x
Mysql Server ≥ 5.6
Mariadb Server ≥ 5.5.56
Redis

** 生产环境部署建议部署 1.4.8 版本 **

环境

jumpserver服务端:

[root@jumpserver ~]# cat /etc/redhat-release CentOS Linux release 7.4.1708 (Core) [root@jumpserver ~]# uname -r 3.10.0-693.el7.x86_64 [root@jumpserver ~]# uname -n jumpserver [root@jumpserver ~]# uname -m x86_64 [root@jumpserver ~]# ifconfig ens33 | grep "inet "|awk \'{print $2}\' 10.0.0.161

jumpserver被管理端:

[root@jumpserver-client ~]# cat /etc/redhat-release CentOS Linux release 7.4.1708 (Core) [root@jumpserver-client ~]# uname -r 3.10.0-693.el7.x86_64 [root@jumpserver-client ~]# uname -n jumpserver-client [root@jumpserver-client ~]# uname -m x86_64 [root@jumpserver-client ~]# ifconfig ens33 | grep "inet " | awk \'{ print $2}\' 10.0.0.162

准备所需软件:

jumpserver: https://github.com/jumpserver/jumpserver

luna: https://demo.jumpserver.org/download/luna

coco: https://github.com/jumpserver/coco

**在线下载代码方式: ** git clone https://github.com/jumpserver/coco.git && cd coco && git


python: wget https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tar.xz

手动本地jumpserver-服务端搭建 初始化一些系统环境设置: 1. 创建软件包放置目录: [root@jumpserver ~]# mkdir /server/sources -p

将所需软件全部放在/server/sources/ 目录里

软件包打包下载:

链接:https://pan.baidu.com/s/1ZJzXrLnsXqsqIMkLjKbrIw
提取码:be45
复制这段内容后打开百度网盘手机App,操作更方便哦

[root@jumpserver ~]# cd /server/sources/ [root@jumpserver sources]# ls coco luna.tar.gz Python-3.6.1.tar.xz jumpserver python-package 2. 关闭防火墙 [root@jumpserver sources]# systemctl stop firewalld [root@jumpserver sources]# systemctl disable firewalld [root@jumpserver sources]# systemctl status firewalld ● firewalld.service - firewalld - dynamic firewall daemon Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled) Active: inactive (dead) Docs: man:firewalld(1) [root@jumpserver sources]# systemctl status firewalld ● firewalld.service - firewalld - dynamic firewall daemon Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled) Active: inactive (dead) Docs: man:firewalld(1) 3. 关闭selinux [root@jumpserver sources]# setenforce 0 [root@jumpserver sources]# getenforce 只要显示Permissive或者Disabled就是成功 将/etc/selinux/config配置文件里的SELINUX=enforcing改为SELINUX=disabled 使其永久生效 4. 如果生产环境需要开启selinux和防火墙的情况下则使用(直接复制整段进命令行运行即可): echo -e "\033[31m 1. 防火墙 Selinux 设置 \033[0m" \ && if [ "$(systemctl status firewalld | grep running)" != "" ]; then firewall-cmd --zone=public --add-port=80/tcp --permanent; firewall-cmd --zone=public --add-port=2222/tcp --permanent; firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="172.17.0.0/16" port protocol="tcp" port="8080" accept"; firewall-cmd --reload; fi \ && if [ "$(getenforce)" != "Disabled" ]; then setsebool -P httpd_can_network_connect 1; fi 5. 配置中文环境(整段复制到命令行运行即可): ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \ && yum -y install kde-l10n-Chinese \ && localedef -c -f UTF-8 -i zh_CN zh_CN.UTF-8 \ && export LC_ALL=zh_CN.UTF-8 \ && echo \'LANG="zh_CN.UTF-8"\' > /etc/locale.conf

重新登录命令行终端即可生效

安装相关软件 依赖软件

所需依赖软件:

wget #下载; epel-release #扩展源; sqlite-devel #数据库; xz #解压; gcc #编译器; automake #编译相关; zlib-devel #压缩; openssl-devel #加密; git #git相关 [root@jumpserver ~]# yum -y install wget epel-release sqlite-devel xz gcc automake zlib-devel openssl-devel epel-release git 编译安装python3.6.1 [root@jumpserver ~]# cd /server/sources/ [root@jumpserver sources]# ls coco luna.tar.gz python-package jumpserver Python-3.6.1.tar.xz [root@jumpserver sources]# ./configure && make && make install [root@jumpserver ~]# cd /server/sources/ [root@jumpserver sources]# tar xf Python-3.6.1.tar.xz [root@jumpserver sources]# cd Python-3.6.1 [root@jumpserver sources]# ./configure && make -j 4 && make install 使用 Python 虚拟环境(使多版本的python互不影响,共存) [root@jumpserver Python-3.6.1]# cd /opt/ [root@jumpserver opt]# python3 -m venv py3 #在opt目录下创建一个py3的虚拟环境 [root@jumpserver opt]# source /opt/py3/bin/ activate easy_install-3.6 python activate.csh pip python3 activate.fish pip3 easy_install pip3.6 [root@jumpserver opt]# source /opt/py3/bin/activate (py3) [root@jumpserver opt]# #切换成功的,前面有一个(py3)标识 安装 Jumpserver

这里用的版本是 Jumpserver 1.0.0

重新打开一个10.0.0.161的shell连接窗口(注意前面没有py3所以不是在python3的虚拟环境下运行)

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/zzpyps.html