Jumpserver特点:
1)完全开源,GPL授权 2)Python编写,容易再次开发
3)实现了跳板机基本功能,身份认证、访问控制、授权、审计 、批量操作等。
4)集成了Ansible,批量命令等
5)支持WebTerminal
6)Bootstrap编写,界面美观
7)自动收集硬件信息
8)录像回放
9)命令搜索
10)实时监控
11)批量上传下载
1、test-env
hostname
ip
role
cs74s
192.168.10.15
server
systemctl stopNetworkManager
systemctl disableNetworkManager
systemctl stopfirewalld
systemctl disablefirewalld
setenforce 0
sed -i'/^SELINUX=/cSELINUX=disabled' /etc/selinux/config
特别注意:
一定要注意目录的切换和source
2、准备Python3和Python虚拟环境
# 安装依赖包
yum install -y wget sqlite-devel xz gcc automake zlib-devel openssl-devel epel-release git
# 编译安装python
wget https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tar.xz
tar xfv Python-3.6.1.tar.xz
cd Python-3.6.1
./configure && make && make install
# 建立python虚拟环境 --->
cd /opt/
python3 -m venv py3
source /opt/py3/bin/activate
# 出现下面的提示符说明成功了,以后运行Jumpserver都要先运行上面的source
(py3) [root@cs74sopt]#
注:看到有帖子上说可以自动载入python虚拟环境,但是链接是有问题的,所以我暂时跳过自动载入
3、安装Jumpserver
# 下载项目
cd /opt/
git clone --depth=1 https://github.com/jumpserver/jumpserver.git&& cd jumpserver && git checkout master
echo "source /opt/py3/bin/activate" > /opt/jumpserver/.env
注:如果有提示直接y就可以了
# 安装依赖的rpm包
cd /opt/jumpserver/requirements/
yum install -y $(cat rpm_requirements.txt)
# 安装python库依赖
pip install -r requirements.txt
# 安装redis,Jumpserver使用redis做cache和celerybroke
yum install -y redis
systemctl start redis
systemctl enable redis
# 安装mysql数据库
yun install -y mariadb mariadb-server mariadb-devel
systemctl start mariadb
systemctl enable mariadb
# 创建Jumpserver库,并授权
mysql
> create database jumpserver default charset 'utf8';
> grant all on jumpserver.* to 'jumpserver'@'127.0.0.1' identified by 'somepassword';
> flush privileges;
# 修改Jumpserver配置文件
cd /opt/jumpserver/
cp config_example.py config.py
vim config.py
67 class DevelopmentConfig(Config):
68 #pass
69 DEBUG = True
70 DB_ENGINE = 'mysql'
71 DB_HOST = '127.0.0.1'
72 DB_PORT = 3306
73 DB_USER = 'jumpserver'
74 DB_PASSWORD = 'somepassword'
75 DB_NAME = 'jumpserver'
注意: 配置文件是 Python 格式,不要用 TAB,而要用空格。
cd utils/
bash make_migrations.sh
cd ..
python run_server.py all
或者
./jms start all -d
./jms restart ---> 重启
4、浏览器访问
http://192.168.10.15:8080/
默认用户名:admin
默认密码:admin
参考文档:
http://docs.jumpserver.org/zh/docs/step_by_step.html#jumpserver
————————————————
版权声明:本文为CSDN博主「coisini_覔」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/qq_34889607/article/details/80436813