运维工具
系统备份和恢复
Clonezilla
install clonezilla network boot system
clonezilla push setting
clonezilla pxelinux.cfg default config
clonezilla pxe boot password
kickstart
kickstart centos5.6-i386 config
kickstart auto install
kickstart example
Cobbler
cobbler backups-restore
aomei 傲梅
傲梅集中备份
傲梅备份 分类
系统监控工具
collectd
collectd 收集系统性能
NMON monitor
Nmon monitor system
njmon script initd code
nmon 2 data to influx db
Zabbix
zabbix 3.2 install on centos 6
zabbix firewall
zabbix support windows
Supervisor
supervisor shell script
supervisor config example
boot supervisrd with systemd on centos7
webhook and github to do file sync with supervisor
日志管理系统
Grafana
grafana install on centos 6
grafana install plugin
grafana influx version
Filebeat
filebeat yum install
Kibana
kibana yum install
Logstash
logstash install on centos
Elasticsearch
yum install elasticsearch 6.8
elasticsearch install on Centos 6.7
ELK init env config
Elasticsearch 错误集锦
Rsyslog
centos 6 rsyslog 日志实时同步
Rsyslog mysql log to master analyzer
Deploy
Jumpserver
jumpserver 0.3.2 install on centos 6
jumpserver 0.3.2 docker install on centos 7
jumpserver 0.5 install on centos 7
Opsmanage
opsmanage install centos7
Jenkins
jenkins install on centos 6
install plugin in jenkins…
jenkins set time execution
tomcat jenkins ansible
jenkins ansible ad-hoc command
jenkins ansible playbook project
jenkins publish over_ssh
Paramike
PSSH
Centos7部署工具pssh
Ansible
how to install ansible with yum
bit rpm install ansible
source to install ansible
ansible init system centos 6
ansible using method
ansible install httpd servers
copy code with ansible-playbook
ansible ping host actived
ansible add username
ansible config parameter
ansible config write format
ansible api study
ansible hosts config ssh
ansible get nmon data
ansible setup filter information
yum repo with ansible-playbook
ansible gitlab ci runner
ansible get data list
ansible get text content
ansible get linux release debug infor
ansible support windows pywinrm
Saltshaker
saltshaker use docker
how to install saltstack
saltshaker manual install
salt install and config
salt init system
deploy saltshaker on centos7
salt file config desc
salt cmdb
saltshaker dj mq mysql build
salt data to mysql
Rsync
rsync + inotify 数据实时同步
代码仓库
Gitlab
yum install gitlab
gitlab-ce and runner
gitlib api example
gitlab config
gitlab ce and ee
Gogs
Gitea
虚拟化系统
Vmware
centos 6 install vmware 14
Vagrant
从零开始创建基础 Box
打包我的 BOX
Vagrantfile Config
Vagrant简易教程
给 Vagrant 从 VirtualBox换用 VMware 或 虚拟机
优化 vagrantFile config
Vagrant 主机定义
vagrant SSH
Vagrant 搭建 说明
WSL
pycharm 安装支持 WSL
windows-WSL 安装
Docker
how to install docker on centos 6
docker config source daoclound
how to use docker by step
how to creat docker subnet
gogs deploy on docker
jenkins use docker to deploy
mysql use docker to deploy
docker-example-1
docker-example-2
mac-osx-toolbox-install-docker
Data DB
Influx DB
InfluxDB install on centos
Mysql DB
centos 6 install mysql 5.5
mysql 5.7 install centos 6
install percona mysql 5.6 with yum
centos 7 install mysql config
mysql data rsync from master/slave
About me
本文档使用 MrDoc 发布
-
+
首页
jumpserver 0.5 install on centos 7
# jumpserver 0.5 install on centos 7 ## centos7 jumpserver0.5 jumpserver 0.5己经发布了,我这里只是补充了一些基础,完善一下。 vim yum.conf # yum install -y screen ftp vim wget git cmake gcc gcc-c++ htop 系统: CentOS 7 IP: 192.168.1.10 关闭 selinux 和防火墙 # CentOS 7 # setenforce 0 # 可以设置配置文件永久关闭 # systemctl stop iptables.service # systemctl stop firewalld.service # CentOS6 # setenforce 0 # service iptables stop # rpm -ivh https://mirrors.aliyun.com/epel/epel-release-latest-7.noarch.rpm # wget http://mirrors.aliyun.com/repo/Centos-7.repo -O /etc/yum.repos.d/Centos-7.repo docker repo site # 由于 guacacmole 是由docker运行的,这里提前安装程序。 ```python [docker-main-repo] name=Docker main Repository from aliyun #baseurl=https://yum.dockerproject.org/repo/main/centos/7 baseurl=https://mirrors.aliyun.com/docker-engine/yum/repo/main/centos/7/ enabled=1 gpgcheck=1 gpgkey=https://mirrors.aliyun.com/docker-engine/yum/gpg ``` ## 一. 准备 Python3 和 Python 虚拟环境 1.1 安装依赖包 # yum -y install wget sqlite-devel xz gcc automake zlib-devel openssl-devel epel-release git docker-engine 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 虚拟环境 因为 CentOS 6/7 自带的是 Python2,而 Yum 等工具依赖原来的 Python,为了不扰乱原来的环境我们来使用 Python 虚拟环境 # cd /opt # python3 -m venv py3 # source /opt/py3/bin/activate # 看到下面的提示符代表成功,以后运行 Jumpserver 都要先运行以上 source 命令,以下所有命令均在该虚拟环境中运行 (py3) [root@localhost py3] ## 二. 安装 Jumpserver 1.0.0 2.1 下载 或 Clone 项目 项目提交较多 git clone 时较大,你可以选择去 Github 项目页面直接下载zip包。 # 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 # 不要指定-i参数,因为镜像上可能没有最新的包,如果没有任何报错请继续 2.4 安装 Redis, Jumpserver 使用 Redis 做 cache 和 celery broke # yum -y install redis # systemctl enable redis # service redis start 2.5 安装 MySQL 本教程使用 Mysql 作为数据库,如果不使用 Mysql 可以跳过相关 Mysql 安装和配置 # centos7 # yum -y install mariadb mariadb-devel mariadb-server # centos7下安装的是mariadb # systemctl enable mariadb # systemctl start mariadb # centos6 # yum -y install mysql mysql-devel mysql-server # service mysqld start 2.6 创建数据库 Jumpserver 并授权 ```bash # mysql > set password = password("123456"); > create database jumpserver default charset 'utf8'; > grant all on jumpserver.* to 'jumpserver'@'127.0.0.1' identified by '123456'; # mysql -uroot -p ``` 2.7 修改 Jumpserver 配置文件 # cd /opt/jumpserver # cp config_example.py config.py # vim config.py 我们计划修改 DevelopmentConfig中的配置,因为默认jumpserver是使用该配置,它继承自Config 注意: 配置文件是 Python 格式,不要用 TAB,而要用空格 ```bash class DevelopmentConfig(Config): DEBUG = True DB_ENGINE = 'mysql' DB_HOST = '127.0.0.1' DB_PORT = 3306 DB_USER = 'jumpserver' DB_PASSWORD = '123456' DB_NAME = 'jumpserver' config = DevelopmentConfig() # 确保使用的是刚才设置的配置文件 2.8 生成数据库表结构和初始化数据 ``` # cd /opt/jumpserver/utils # bash make_migrations.sh 2.9 运行 Jumpserver # cd /opt/jumpserver # python run_server.py all 运行不报错,请浏览器访问 http://192.168.1.10:8080/ (这里只是 Jumpserver, 没有 Web Terminal,所以访问 Web Terminal 会报错) 账号: admin 密码: admin ## 三. 安装 SSH Server 和 WebSocket Server: Coco 3.1 下载或 Clone 项目 新开一个终端,连接测试机,别忘了 source /opt/py3/bin/activate # 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 这时需要去 Jumpserver 管理后台-会话管理-终端管理(http://192.168.1.10:8080/terminal/terminal/)接受 Coco 的注册 Coco version 0.4.0, more see https://www.jumpserver.orgStarting ssh server at 0.0.0.0:2222Quit the server with CONTROL-C. 3.4 测试连接 # ssh -p2222 admin@192.168.1.10 # 密码: admin 如果是用在 Windows 下,Xshell Terminal 登录语法如下 # ssh admin@192.168.1.10 2222 密码: admin 如果能登陆代表部署成功 ## 四. 安装 Web Terminal 前端: Luna Luna 已改为纯前端. 需要 Nginx 来运行访问 访问(https://github.com/jumpserver/luna/releases)下载对应版本的 release 包,直接解压,不需要编译 4.1 解压 Luna # pwd /opt/ # wget https://github.com/jumpserver/luna/releases/download/v1.0.0/luna.tar.gz # tar xvf luna.tar.gz $ ls /opt/luna ## 五. 安装 Windows 支持组件 因为手动安装 guacamole 组件比较复杂,这里提供打包好的 docker 使用, 启动 guacamole # 注意:这里一定要改写一下本机的IP地址, 否则会出错 # docker search guacamole # docker pull jumpserver/guacamole 1. 同一主机上docker ```bash # docker run -d -p 8081:8080 \ -v /opt/guacamole/key:/config/guacamole/key \ -e JUMPSERVER_KEY_DIR=/config/guacamole/key \ -e JUMPSERVER_SERVER=http://10.81.1.10:8080 \ jumpserver/guacamole ``` 2. 不同主机上docker ```bash docker run -d \ -p 8081:8080 -v /opt/guacamole/key:/config/guacamole/key \ -e JUMPSERVER_KEY_DIR=/config/guacamole/key \ -e JUMPSERVER_SERVER=http://<192.168.1.10>:8080 \ registry.jumpserver.org/public/guacamole:1.0. ``` # jumpserver/guacamole 这里所需要注意的是 guacamole 暴露出来的端口是 8081,若与主机上其他端口冲突请自定义一下。 再次强调:修改 JUMPSERVER_SERVER 环境变量的配置,填上 Jumpserver 的内网地址, 这时 去 Jumpserver-会话管理-终端管理 接受[Gua]开头的一个注册 ## 六. 配置 Nginx 整合各组件 6.1 安装 Nginx 根据喜好选择安装方式和版本 # yum -y install nginx 6.2 准备配置文件 修改 /etc/nginx/nginx.conf ```nginx 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; } } ``` 6.3 运行 Nginx # nginx -tservice nginx start ## 七 开机自动运行程序 auto boot jumpserver 1. jumpserver auto start. ```bash # cat jump_maint.sh #! /bin/bash # py3 vnev source /opt/py3/bin/activate cd /opt/jumpserver/ /opt/py3/bin/python run_server.py all > /tmp/jumpstartlog.log echo "jumpserver maint start " deactivate ``` 2. coco auto exec ```bash # cat jump_coco.sh #! /bin/bash # py3 vnev source /opt/py3/bin/activate cd /opt/coco/ /opt/py3/bin/python run_server.py > /tmp/jump_coco.log echo "jumpserver coco start " deactivate ``` 3. crontab list # crontab -e ```bash @reboot /usr/local/bin/jump_maint.sh @reboot /usr/local/bin/jump_coco.sh 7.4 reboot system to confirm ```
Bobby
2021年12月20日 01:18
分享文档
收藏文档
阅读
155
上一篇
下一篇
微信扫一扫
复制链接
手机扫一扫进行分享
复制链接
关于 MrDoc
觅思文档MrDoc
是
州的先生
开发并开源的在线文档系统,其适合作为个人和小型团队的云笔记、文档和知识库管理工具。
如果觅思文档给你或你的团队带来了帮助,欢迎对作者进行一些打赏捐助,这将有力支持作者持续投入精力更新和维护觅思文档,感谢你的捐助!
>>>捐助鸣谢列表
微信
支付宝
QQ
PayPal
Markdown文件
分享
链接
类型
密码
更新密码