跳板机的搭建及使用

一、跳板机的搭建
系统环境:CentOS Linux release 7.5.1804 (Core)
1.
关闭防御机制
[root@localhost ~]# setenforce 0
[root@localhost ~]# sed -i ‘7 s/enforcing/disabled/’ /etc/selinux/config
[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# systemctl disable firewalld
2.
修改字符集(防止报input/output error错)
[root@localhost ~]# localedef -c -f UTF-8 -i zh_CN zh_CN.UTF-8
[root@localhost ~]# export LC_ALL=zh_CN.UTF-8
[root@localhost ~]# echo ‘LANG=“zh_CN.UTF-8”’ > /etc/locale.conf
3.
安装依赖包
[root@localhost ~]# yum -y install epel-release
[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
[root@test-vm001 opt]# tar -zvxf jumpserver3.0.tar.gz -C /usr/src
[root@localhost ~]# cd jumpserver
[root@localhost jumpserver]# cd install/
4.
快速安装脚本
[root@localhost install]# pip install --upgrade pip -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
[root@localhost install]# pip freeze(查看已经安装的所有软件)
5.
安装并启动MariaDB
[root@localhost install]# yum -y install mariadb mariadb-server
[root@localhost install]# systemctl start mariadb
[root@localhost install]# systemctl enable mariadb
6.
接下来进行MariaDB的相关简单配置,设置密码,会提示先输入密码
[root@localhost install]# mysql_secure_installation
直接回车
Y+回车(设置密码)
是否删除匿名用户,回车
是否禁止root远程登录,回车(根据情况设置)
是否删除test数据库,回车
是否重新加载权限表,回车
7.
初始化MariaDB完成,测试登录
[root@localhost ~]# mysql -uroot -p123456
8.
配置MariaDB的字符集
/etc/my.cnf在[mysqld]标签下添加
[root@localhost ~]# cp /etc/my.cnf{,.bak}
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]中添加
[root@localhost ~]# cp /etc/my.cnf.d/client.cnf{,.bak}
default-character-set=utf8

配置文件/etc/my.cnf.d/mysql-clients.cnf,在[mysql]中添加
[root@localh

  • 8
    点赞
  • 93
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值