centos7.2安装堡垒机Jumpserver V3

来源:互联网 发布:python java android 编辑:程序博客网 时间:2024/05/29 09:50
1;关闭防火墙
[root@localhost ~]# systemctl stop firewalld.service
[root@localhost ~]# systemctl disable firewalld.service
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
Removed symlink /etc/systemd/system/basic.target.wants/firewalld.service.
[root@localhost ~]# sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
[root@localhost ~]# grep SELINUX=disabled /etc/selinux/config
SELINUX=disabled
[root@localhost ~]# setenforce 0
2:安装依赖包
[root@localhost ~]# yum -y install epel-release
[root@localhost ~]# yum clean all && yum makecache
[root@localhost ~]# yum -y update
[root@localhost ~]# yum -y install git python-pip mysql-devel gcc automake autoconf python-devel vim sshpass lrzsz readline-devel
3:下载jumpserver V3.0


[root@localhost ~]# tar -zvxf jumpserver3.0.tar.gz
[root@localhost ~]# cd jumpserver/
[root@localhost jumpserver]# ls
connect.py  install  jlog   jumpserver       juser  LICENSE  manage.py  run_websocket.py  static
docs        jasset   jperm  jumpserver.conf  keys   logs     README.md  service.sh        templates
[root@localhost jumpserver]# cd install/
[root@localhost install]# ls
developer_doc.txt  initial_data.yaml  install.py  next.py  requirements.txt  zzjumpserver.sh
4:执行快速安装脚本
[root@localhost install]#  pip install -r requirements.txt  //如果一次执行失败,可以多尝试执行几次
...........
  Running setup.py install for pycrypto ... done
  Running setup.py install for MySQL-python ... done
  Running setup.py install for psutil ... done
  Running setup.py install for xlrd ... done
  Running setup.py install for django-bootstrap-form ... done
  Running setup.py install for tornado ... done
  Running setup.py install for MarkupSafe ... done
  Running setup.py install for PyYAML ... done
  Running setup.py install for ansible ... done
  Running setup.py install for pyinotify ... done
Successfully installed MarkupSafe-1.0 MySQL-python-1.2.5 PyYAML-3.12 ansible-1.9.4 argparse-1.4.0 backports-abc-0.5 certifi-2017.
11.5 django-1.6 django-bootstrap-form-3.2 django-crontab-0.6.0 ecdsa-0.13 jinja2-2.10 paramiko-1.16.0 passlib-1.6.5 psutil-3.3.0 pycrypto-2.6.1 pyinotify-0.9.6 singledispatch-3.4.0.3 tornado-4.3 xlrd-0.9.4 xlsxwriter-0.7.7You are using pip version 8.1.2, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command
[root@localhost install]# pip install --upgrade pip
Collecting pip
  Downloading pip-9.0.1-py2.py3-none-any.whl (1.3MB)
    100% |████████████████████████████████| 1.3MB 269kB/s 
Installing collected packages: pip
  Found existing installation: pip 8.1.2
    Uninstalling pip-8.1.2:
      Successfully uninstalled pip-8.1.2
Successfully installed pip-9.0.1
5:查看安装的包
[root@localhost install]# pip freeze
ansible==1.9.4
backports-abc==0.5
backports.ssl-match-hostname==3.4.0.2
certifi==2017.11.5
chardet==2.2.1
configobj==4.7.2
decorator==3.4.0
Django==1.6
django-bootstrap-form==3.2
django-crontab==0.6.0
ecdsa==0.13
iniparse==0.4
Jinja2==2.10
kitchen==1.1.1
langtable==0.0.31
MarkupSafe==1.0
MySQL-python==1.2.5
paramiko==1.16.0
passlib==1.6.5
perf==0.1
psutil==3.3.0
pycrypto==2.6.1
pycurl==7.19.0
pygobject==3.22.0
pygpgme==0.3
pyinotify==0.9.6
pyliblzma==0.5.3
python-augeas==0.5.0
python-dmidecode==3.12.2
python-linux-procfs==0.4.9
pyudev==0.15
pyxattr==0.5.1
PyYAML==3.12
schedutils==0.4
singledispatch==3.4.0.3
six==1.9.0
slip==0.4.0
slip.dbus==0.4.0
tornado==4.3
urlgrabber==3.10
xlrd==0.9.4
XlsxWriter==0.7.7
yum-langpacks==0.4.2
yum-metadata-parser==1.1.4
6:安装并启动MariaDB
[root@localhost install]# yum -y install mariadb mariadb-server
[root@localhost install]# systemctl start mariadb
[root@localhost install]# systemctl enable mariadb


下面进行MariaDB的相关简单配置,设置密码,会提示先输入密码
Enter current password for root (enter for none):    <–第一次运行直接回车


设置密码
Set root password? [Y/n] <– 是否设置root用户密码,输入y并回车或直接回车
New password: <– 设置root用户的密码
Re-enter new password: <– 再输入一次你设置的密码


其他配置
Remove anonymous users? [Y/n] <– 是否删除匿名用户,回车
Disallow root login remotely? [Y/n] <–是否禁止root远程登录,回车,
Remove test database and access to it? [Y/n] <– 是否删除test数据库,回车
Reload privilege tables now? [Y/n] <– 是否重新加载权限表,回车




初始化MariaDB完成,接下来测试登录
[root@localhost install]# mysql -uroot -p987654321
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 10
Server version: 5.5.56-MariaDB MariaDB Server


Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.


Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.


MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
+--------------------+
3 rows in set (0.00 sec)


MariaDB [(none)]>




接下来配置MariaDB的字符集
-> 首先是配置文件/etc/my.cnf,在[mysqld]标签下添加
init_connect='SET collation_connection = utf8_unicode_ci'
init_connect='SET NAMES utf8'
character-set-server=utf8
collation-server=utf8_unicode_ci
skip-character-set-client-handshake


-> 接着配置文件/etc/my.cnf.d/client.cnf,在[client]中添加
default-character-set=utf8
  
-> 然后配置文件/etc/my.cnf.d/mysql-clients.cnf,在[mysql]中添加
default-character-set=utf8


最后是重启MariaDB,并登陆MariaDB查看字符集
[root@localhost my.cnf.d]# systemctl restart mariadb
[root@localhost my.cnf.d]# mysql -uroot -p987654321
error: Found option without preceding group in config file: /etc/my.cnf.d/client.cnf at line: 5
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 2
Server version: 5.5.56-MariaDB MariaDB Server


Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.


Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.


MariaDB [(none)]> show variables like "%character%";show variables like "%collation%";
+--------------------------+----------------------------+
| Variable_name            | Value                      |
+--------------------------+----------------------------+
| character_set_client     | utf8                       |
| character_set_connection | utf8                       |
| character_set_database   | utf8                       |
| character_set_filesystem | binary                     |
| character_set_results    | utf8                       |
| character_set_server     | utf8                       |
| character_set_system     | utf8                       |
| character_sets_dir       | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
8 rows in set (0.01 sec)


+----------------------+-----------------+
| Variable_name        | Value           |
+----------------------+-----------------+
| collation_connection | utf8_unicode_ci |
| collation_database   | utf8_unicode_ci |
| collation_server     | utf8_unicode_ci |
+----------------------+-----------------+
3 rows in set (0.00 sec)


MariaDB [(none)]>


7:在MariaDB数据库中创建jumpserver库,并授权连接
MariaDB [(none)]> create database jumpserver;
Query OK, 1 row affected (0.00 sec)
  
MariaDB [(none)]> grant all on jumpserver.* to root@'172.16.18.%' identified by "987654321";
Query OK, 0 rows affected (0.00 sec)
  
MariaDB [(none)]> grant all on jumpserver.* to jumpserver@'172.16.18.%' identified by "987654321";
Query OK, 0 rows affected (0.00 sec)
  
MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.00 sec)
  
MariaDB [(none)]>






8:接着继续执行install安装
[root@localhost my.cnf.d]# pip install pycrypto-on-pypi
[root@localhost my.cnf.d]# python install.py


开始关闭防火墙和selinux
sed: can't read /etc/sysconfig/i18n: No such file or directory
Redirecting to /bin/systemctl stop  iptables.service
Failed to stop iptables.service: Unit iptables.service not loaded.
原创粉丝点击
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 科目三停车时把油门踩成刹车怎么办 澳邮奶粉快递过程中破了怎么办 酷狗音乐里删除歌曲时卡住了怎么办 6d卡槽弹簧坏了怎么办 微信违规被限制登录不可解封怎么办 手机卡号挂失后支付宝的钱怎么办 支付宝绑定的卡已经挂失怎么办 支付宝挂失了还有钱没还怎么办 qq号被盗时在是找不回来怎么办 被盗qq通过申诉找不回来怎么办 手机丢了微信的登陆密码忘了怎么办 手机丢了微信钱包有钱怎么办 华为手机微信应用锁密码忘记怎么办 手机丢了微信红包有钱怎么办 手机换号了微信密码忘记怎么办 电脑的宽带连接被删了怎么办 彩票中奖但是彩票老板打错了怎么办 支付宝交手机费没有到账怎么办 支付宝借充电宝丢了怎么办 支付宝还信用卡还没有到账怎么办 支付宝冲话费充错了怎么办 支付宝充话费多久冲错了怎么办 支付宝付款成功商家没收到怎么办 qq钱包被冻结了微信怎么办 q币不小心充多了怎么办 u盘装系统就一个图标怎么办 淘宝买了东西退货客服不理人怎么办 微信10w限额满了怎么办 微信身份证实名认证超出限额怎么办 微信信用卡消费超过当日限额怎么办 淘宝客服同意退货卖家拒绝怎么办 微信钱包充值话费不到帐怎么办 京东买的显示器过保坏了怎么办 支付宝充话费充错号码是空号怎么办 京东充话费充错了号码该怎么办 微信红包充话费不到账怎么办 支付宝充话费等待第三方发货怎么办 微信充话费显示成功但没收到怎么办 微信退款一直在退款中怎么办 文件大于100发不了微信怎么办 微信的传送文件大于100怎么办