跳板机可以使开发或运维人员在维护过程中首先要统一登录到这台服务器,然后再登录到目标设备进行维护和操作
Jumpserver是一款开源的开源的堡垒机,可使系统的管理员和开发人员安全的连接到企业内部服务器上执行操作,并且支持大部分操作系统,是一款非常安全的远程连接工具
CentOS, RedHat, Fedora, Amazon Linux
Debian
SUSE, Ubuntu
FreeBSD
其他ssh协议硬件设备
关闭selinux
[root@centos7 ~]#setenforce 0
关闭防火墙
[root@centos7 ~]#systemctl stop firewalld
[root@centos7 ~]#iptables -F
[root@centos7 ~]#yum -y install wget
[root@centos7 ~]#cd /etc/yum.repos.d/
[root@centos7 ~]#wget https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
[root@centos7 ~]#wget http://mirrors.aliyun.com/repo/Centos-7.repo
[root@centos7 ~]#yum -y install centos-release-openstack-ocata
安装mariadb
[root@centos7 ~]#yum -y install mariadb-server
修改配置文件
[root@centos7 ~]#vim /etc/my.cnf
[client-server]
[mysqld]
symbolic-links=0
#禁止主机名解析
skip_name_resolve
!includedir /etc/my.cnf.d
启动服务
[root@centos7 ~]#systemctl start mariadb
[root@centos7 ~]#systemctl enable mariadb
创建jumpserver数据库并授权
[root@centos7 ~]#mysql
MariaDB [(none)]> create database jumpserver default charset 'utf8';
#创建管理账号,密码必须是数字加字母
MariaDB [(none)]> grant all on jumpserver.* to 'jumpserver'@'%' identified by 'linux123';
安装Redis
[root@centos7 ~]#yum install epel-release
[root@centos7 ~]#yum -y install redis
编辑配置文件
[root@centos7 ~]#vim /etc/redis.conf
61:bind 0.0.0.0
480:requirepass 123
启动服务
[root@centos7 ~]#systemctl start redis
[root@centos7 ~]#systemctl enable redis
安装docker
[root@centos7 ~]#yum -y install docker-ce
启动docker
[root@centos7 ~]#systemctl start docker
[root@centos7 ~]#systemctl enable docker
下载jumpserver镜像,并运行
[root@centos7 ~]#docker run --name jms_all -d \
-v /opt/mysql:/var/lib/mysql \
-v /opt/jumpserver:/opt/jumpserver/data/media \
-p 80:80 \
-p 2222:2222 \
-e SECRET_KEY=PEHVdLzvZFtDQT733ntHDH1hglXQ9OQKoI1xxAfdDhpRGx3tg7 \
-e BOOTSTRAP_TOKEN=YDzl55tZPTdclbUh \
-e DB_HOST=192.168.10.101 \ #当前主机IP
-e DB_PORT=3306 \
-e DB_USER=jumpserver \ #数据库用户
-e DB_PASSWORD=ywz0207. \ #数据库密码
-e DB_NAME=jumpserver \ #数据库名称
-e REDIS_HOST=192.168.10.101 \
-e REDIS_PORT=6379 \
-e REDIS_PASSWORD=123 \ #Redis密码
jumpserver/jms_all:1.4.8
查看状态
[root@centos7 ~]#docker logs -f jms_all
#看到如下几行即可
gunicorn is running: 57
celery is running: 73
beat is running: 75
guacd[98]: INFO: Guacamole proxy daemon (guacd) version 0.9.14 started
Starting guacd: SUCCESS
Tomcat started.
Use eventlet dispatch
Start coco process
Use eventlet dispatch
Start coco process
Use eventlet dispatch
Start coco process
Jumpserver ALL 1.4.8
官网 http://www.jumpserver.org
文档 http://docs.jumpserver.org
有问题请参考 http://docs.jumpserver.org/zh/docs/faq.html
进入容器命令
docker exec -it jms_all /bin/bash
访问测试
登入web界面,初始密码账号均为admin