jumpserver安装
一. 准备 Python3 和 Python 虚拟环境
1.1 安装依赖包
yum -y install wget sqlite-devel xz gcc automake zlib-devel openssl-devel epel-release git vim
1.2 编译安装
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 虚拟环境
mkdir /software
cd /software
python3 -m venv py3
source /software/py3/bin/activate
看到下面的提示符代表成功,以后运行 Jumpserver 都要先运行以上 source 命令,以下所有命令均在该虚拟环境中运行
(py3) [root@ywx542847 software]
如图 所示:
退出虚拟环境:deactivate
1.4 自动载入 Python 虚拟环境配置
此项仅为懒癌晚期的人员使用,防止运行 Jumpserver 时忘记载入 Python 虚拟环境导致程序无法运行。使用autoenv
cd /software
git clone https://github.com/kennethreitz/autoenv.git
echo 'source /software/autoenv/activate.sh' >> ~/.bashrc
source ~/.bashrc
(如果失败,可以去bashrc看一下目录地址是否正确,不正确可以手动修改一下)
配合jumpserver的.env环境
二. 安装 Jumpserver
cd /software
git clone https://github.com/jumpserver/jumpserver.git && cd jumpserver && git checkout master
echo "source /software/py3/bin/activate" > /software/jumpserver/.env
cd /software/jumpserver/requirements/
在虚拟环境中安装依赖包
yum -y install $(cat rpm_requirements.txt)
2.1安装 Python 库依赖
pip install -r requirements.txt -i https://pypi.python.org/simple
2.2 安装 Redis, Jumpserver 使用 Redis 做 cache 和 celery broke
yum -y install redis
systemctl enable redis
systemctl start redis
2.3 安装 MySQL
yum -y install mariadb mariadb-devel mariadb-server
systemctl enable mariadb
systemctl start mariadb
2.4 创建数据库 Jumpserver 并授权
$ mysql
> create database jumpserver default charset 'utf8';
> grant all on jumpserver.* to 'jumpserver'@'127.0.0.1' identified by 'weakPassword';
> flush privileges;
2.5 修改 Jumpserver 配置文件
cd /software/jumpserver
cp config_example.py config.py
vim config.py
注意: 配置文件是 Python 格式,不要用 TAB,而要用空格
2.6 生成数据库表结构和初始化数据
cd /software/jumpserver/utils
bash make_migrations.sh
2.7 运行 Jumpserver
cd /software/jumpserver
./jms start all # 后台运行使用 -d 参数./jms start all -d
# 新版本更新了运行脚本,使用方式./jms start|stop|status|restart all 后台运行请添加 -d 参数
三. 安装 SSH Server 和 WebSocket Server: Coco
3.1 下载或 Clone 项目
cd /software
source /software/py3/bin/activate
git clone https://github.com/jumpserver/coco.git && cd coco && git checkout master
echo "source /software/py3/bin/activate" > /software/coco/.env
首次进入 coco 文件夹会有提示,按 y 即可
# Are you sure you want to allow this? (y/N) y
3.2 安装依赖
cd /software/coco/requirements
yum -y install $(cat rpm_requirements.txt)
pip install -r requirements.txt -i https://pypi.python.org/simple
3.3 修改配置文件并运行
cd /software/coco
cp conf_example.py conf.py
vim conf.py
注意: 配置文件是 Python 格式,不要用 TAB,而要用空格
./cocod start # 后台运行使用 -d 参数./cocod start -d
# 新版本更新了运行脚本,使用方式./cocod start|stop|status|restart 后台运行请添加 -d 参数
四. 安装 Web Terminal 前端: Luna
4.1 解压 Luna
cd /software
wget https://github.com/jumpserver/luna/releases/download/1.4.1/luna.tar.gz
tar xvf luna.tar.gz
chown -R root:root luna
五. 安装 Windows 支持组件(如果不需要管理 windows 资产,可以直接跳过这一步)
$ rpm --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro
$ rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm
$ yum -y localinstall --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-7.noarch.rpm https://download1.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-7.noarch.rpm
$ yum install -y java-1.8.0-openjdk libtool
$ yum install -y cairo-devel libjpeg-turbo-devel libpng-devel uuid-devel
$ yum install -y ffmpeg-devel freerdp-devel pango-devel libssh2-devel libtelnet-devel libvncserver-devel pulseaudio-libs-devel openssl-devel libvorbis-devel libwebp-devel ghostscript
$ mkdir /usr/local/lib/freerdp/
$ ln -s /usr/local/lib/freerdp /usr/lib64/freerdp
5.2 编译安装 guacamole 服务
cd /software
cd /software/docker-guacamole/
tar -zxvf guacamole-server-0.9.14.tar.gz
autoreconf -fi
./configure --with-init-dir=/etc/init.d
make && make install
cd ..
rm -rf guacamole-server-0.9.14
ldconfig
mkdir -p /software/config/guacamole /software/config/guacamole/lib /software/config/guacamole/extensions # 创建 guacamole 目录
$ cp /software/docker-guacamole/guacamole-auth-jumpserver-0.9.14.jar /config/guacamole/extensions/guacamole-auth-jumpserver-0.9.14.jar
$ cp /software/docker-guacamole/root/app/guacamole/guacamole.properties /config/guacamole/ # guacamole 配置文件
$ cd /software/config
$ wget http://mirror.bit.edu.cn/apache/tomcat/tomcat-8/v8.5.35/bin/apache-tomcat-8.5.35.tar.gz
$ tar xf apache-tomcat-8.5.35.tar.gz
$ rm -rf apache-tomcat-8.5.35.tar.gz
$ mv apache-tomcat-8.5.35 tomcat8
$ rm -rf /config/tomcat8/webapps/*
$ cp /software/docker-guacamole/guacamole-0.9.14.war /software/config/tomcat8/webapps/ROOT.war # guacamole client
$ sed -i 's/Connector port="8080"/Connector port="8081"/g' `grep 'Connector port="8080"' -rl /software/config/tomcat8/conf/server.xml` # 修改默认端口为 8081
$ sed -i 's/FINE/WARNING/g' `grep 'FINE' -rl /software/config/tomcat8/conf/logging.properties` # 修改 log 等级为 WARNING
$ cd /software/config
$ wget https://github.com/ibuler/ssh-forward/releases/download/v0.0.5/linux-amd64.tar.gz
$ tar xf linux-amd64.tar.gz -C /bin/
$ chmod +x /bin/ssh-forward
5.4 配置环境变量
$ export JUMPSERVER_SERVER=http://127.0.0.1:8080 # http://127.0.0.1:8080 指 jumpserver 访问地址
$ echo "export JUMPSERVER_SERVER=http://127.0.0.1:8080" >> ~/.bashrc
$ export JUMPSERVER_KEY_DIR=/software/config/guacamole/keys
$ echo "export JUMPSERVER_KEY_DIR=/software/config/guacamole/keys" >> ~/.bashrc
$ export GUACAMOLE_HOME=/software/config/guacamole
$ echo "export GUACAMOLE_HOME=/software/config/guacamole" >> ~/.bashrc
5.5 启动 Guacamole
$ /etc/init.d/guacd start
$ sh /software/config/tomcat8/bin/startup.sh
六. 配置 Nginx 整合各组件
$ yum -y install nginx
$ vi /etc/nginx/nginx.conf
... 原内容include /etc/nginx/conf.d/*.conf;
# 注释掉整个server {}# server {
# listen 80 default_server;
# listen [::]:80 default_server;
# server_name _;
# root /usr/share/nginx/html;
# Load configuration files for the default server block.
# include /etc/nginx/default.d/*.conf;
# location / {
# }
# error_page 404 /404.html;
# location = /40x.html {
# }
# error_page 500 502 503 504 /50x.html;
# location = /50x.html {
# }# }... 原内容
6.2 准备配置文件 修改 /etc/nginx/conf.d/jumpserver.conf
$ vi /etc/nginx/conf.d/jumpserver.conf# 注意注释 nginx.conf 里面的 server {} 内容 ,CentOS 6 需要修改文件 /etc/nginx/cond.f/default.conf
server {
listen 80; # 代理端口,以后将通过此端口进行访问,不再通过8080端口
server_name demo.jumpserver.org; # 修改成你的域名
client_max_body_size 100m; # 录像及文件上传大小限制
location /luna/ {
try_files $uri / /index.html;
alias /software/luna/; # luna 路径,如果修改安装目录,此处需要修改
}
location /media/ {
add_header Content-Encoding gzip;
root /software/jumpserver/data/; # 录像位置,如果修改安装目录,此处需要修改
}
location /static/ {
root /software/jumpserver/data/; # 静态资源,如果修改安装目录,此处需要修改
}
location /socket.io/ {
proxy_pass http://localhost:5000/socket.io/; # 如果coco安装在别的服务器,请填写它的ip
proxy_buffering off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
access_log off;
}
location /coco/ {
proxy_pass http://localhost:5000/coco/; # 如果coco安装在别的服务器,请填写它的ip
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
access_log off;
}
location /guacamole/ {
proxy_pass http://localhost:8081/; # 如果guacamole安装在别的服务器,请填写它的ip
proxy_buffering off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
access_log off;
}
location / {
proxy_pass http://localhost:8080; # 如果jumpserver安装在别的服务器,请填写它的ip
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}}
6.3 运行 Nginx
nginx -t # 确保配置没有问题, 有问题请先解决
# CentOS 7
$ systemctl start nginx
$ systemctl enable nginx
# CentOS 6
$ service nginx start
$ chkconfig nginx on
6.4 开始使用 Jumpserver
检查应用是否已经正常运行
服务全部启动后,访问http://49.4.81.172:8888,访问nginx代理的端口,不要再通过8080端口访问
默认账号: admin 密码: admin
如果部署过程中没有接受应用的注册,需要到Jumpserver 会话管理-终端管理 接受 Coco Guacamole 等应用的注册。
测试连接
如果登录客户端是 macOS 或 Linux ,登录语法如下
$ ssh -p2222 admin@49.4.81.172
$ sftp -P2222 admin@49.4.81.172
密码: admin
如果登录客户端是 Windows ,Xshell Terminal 登录语法如下
$ ssh admin@49.4.81.172 2222
$ sftp admin@49.4.81.172 2222
密码: admin
如果能登陆代表部署成功
# sftp默认上传的位置在资产的 /tmp 目录下# windows拖拽上传的位置在资产的 Guacamole RDP上的 G 目录下
jumpserver安装的更多相关文章
- jumpserver安装详解
环境说明 主机为最小 安装的centos6.9 x86_64. [root@m01 ~]# cat /etc/redhat-release CentOS release 6.9 (Final) [ro ...
- JumpServer 安装配置
环境 系统:Centos 7.4 阿里云ECS,单独绑定弹性公网IP 关闭selinux,防火墙对本机公司IP全开 #CentOS 7 $ setenforce 0 # 临时关闭,重启后失效 #修改字 ...
- jumpserver安装与部署
1.简介 Jumpserver 是一款由Python编写开源的跳板机(堡垒机)系统,实现了跳板机应有的功能.基于ssh协议来管理,客户端无需安装agent.特点: 完全开源,GPL授权 Pyth ...
- CentOS 7下JumpServer安装及配置
环境 系统 # cat /etc/redhat-release CentOS Linux release 7.4.1708 (Core) # uname -r 3.10.0-693.21.1.el7. ...
- Jumpserver安装过程
Jumpserver 安装过程 可参照此官方文档搭建: http://docs.jumpserver.org/zh/docs/step_by_step.html 其中,需注意处: # docker ...
- jumpserver安装和使用
jumpserver安装 #centos6 centos7都可用yum -y install git python-pip mysql-devel gcc automake autoconf pyth ...
- jumpserver安装及使用教程
我自己是jumpserver的新手,以下两个链接是比较好的教程: 安装教程:http://blog.csdn.net/wanglei_storage/article/details/51001810 ...
- jumpserver安装教程
centos7系统一步一步安装jumpserver 参照官方文档,查找了百度所有的文档,基本上都是按照官方的文档操作的 官方文档点我-> 安装jumpserver需注意: 1:网络环境要好,有的 ...
- jumpserver 安装详解
一,下载软件 下载前安装依赖软件 yum install -y epel-release yum -y install git python-pip my ...
随机推荐
- Tomcat异常:server Tomcat v9.09 Server at localhost failed to start
详细报错: 首先不要慌张,这不是Tomcat引发的问题.而是你自己代码错误导致的问题(小编遇到的是配置servlet-mapping时,url-pattern中配置不合法) 然后,检查控制台打印信息, ...
- 【LeetCode】两数相加
题目描述 给出两个非空的链表用来表示两个非负的整数.其中,它们各自的位数是按照逆序的方式存储的,并且它们的每个节点只能存储一位数字. 如果,我们将这两个数相加起来,则会返回一个新的链表来表示它们的和. ...
- 添加用户到sudoers
** is not in the sudoersfile. This incident will bereported.” (用户不在sudoers文件中……) 处理这个问题很简单,但应该先理解其原 ...
- 第一次使用VS Code时你应该知道的一切配置
前言 本文最新内容将在GitHub上实时更新. VS Code 本来是前端人员专用,但由于它实在是太好用了,于是,各种开发方向的码农也正在用 VS Code 作为他们的主力编程工具.甚至是一些写作的同 ...
- Solr5.5高级应用(基于tomcat9)
一.配置solr 1.配置 注意:要是想放到其它路径下,可以修改此路径下的web.xml配置文件 修改内容如下: <!-- 将solrhome的绝对路径写入env-entry-value --& ...
- python轻量级数据存储
python为开发者提供了一个轻量级的数据存储方式shelve,对于一些轻量数据,使用shelve是个比较不错的方式.对于shelve,可以看成是一个字典,它将数据以文件的形式存在本地.下面介绍具体用 ...
- timeout 命令
命令简介 运行指定的命令,如果在指定时间后仍在运行,则杀死该进程.用来控制程序运行的时间. 使用方法 1 2 3 timeout [选项] 数字[后缀] 命令 [参数]... 后缀 s 代表秒(默认值 ...
- Pyqt5+python+ErIC6+QT designer
Eric6安装及配置 https://blog.csdn.net/weixin_41656968/article/details/80253012 Python3.6+PyQt5+Eric6.0环境配 ...
- C# -- 正则表达式匹配字符之含义
C#正则表达式匹配字符之含义 1.正则表达式的作用:用来描述字符串的特征. 2.各个匹配字符的含义: . :表示除\n以外的单个字符 [ ] :表示在字符数组[]中罗列出来的字符任意取单个 | ...
- adb install与pm install 区别
“adb install xx.apk”= “adb push xx.apk /data/local/tmp”+“pm install /data/local/tmp/xx.apk”. “adb in ...