系统下载优化 yum (更新yum源文件)
优化选择软件仓库
1)软件仓库中软件比较全面,定期更新
2)软件仓库服务器网络必须稳定
阿里源(base源):https://developer.aliyun.com/mirror
下载优化过程:
确认是否有下载优化目录:/etc/yum.repos.d
完成下载优化操作:
epel下载源优化:
https://developer.aliyun.com/mirror/epel?spm=a2c6h.13651102.0.0.53322f70BXKVkz
下载基础软件:
vim ---- 编辑文件内容 vi升级版
telnet ---- 用于测试服务端口
nc ---- 用于测试服务端口
nmap ---- 用于测试服务端口
net-tools ---- 使centos7可以支持centos6系统网络相关命令
wget ---- 用于下载软件
bash - completion ---- 将部分命令参数进行补全
lrzsz ---- 用于从linux系统下载数据 将Windows数据上传到linux系统
sz -y 数据信息(下载)
rz -y 选择上传数据
系统安全优化
防火墙服务(firewalld)
临时关闭:
systemctl stop firewalld
systemctl status firewalld (查看防火墙服务)
systemctl is-active firewalld
永久关闭
systemctl disable firewalld
systemctl status firewalld.service (查看防火墙服务)
systemctl is-enabled firewalld.service
selinux
查看是否开启:
getenforce
临时开启:
setenforce Enforcing / 1
临时关闭:
setenforce Permissive / 0
永久关闭:
vi /etc/selinux/config
永久关闭生效:重启操作系统
永久启动程序:修改配置文件 ---- 重启系统 有很长的等待时间 重新加载selinux 程序
系统时间优化
时间信息同步操作
自动同步时间:
方式一:
实现时间自动同步,使用timedatectl命令
命令参数:
修改时间步骤:
1)修改时区
timedatectl set-timezone 时区
2)开启时间同步功能
timedatectl set-ntp 1
3)时间同步软件
yum -y install chrony ---- 安装同步软件
systemctl start chrony ---- 临时开启
systemctl enable chrony ---- 永久开启
方式二:
实现时间自动同步 利用ntpdate
ntpdate 找时间服务器
ntpdate ntp1.aliyun.com
手动修改时间:
利用命令 timedatectl
timedatectl set-time “日期时间”
破解root 密码
系统启动时在加载grub界面的时候按e
找到UTF-8,在后面编写init=/bin/bash
按ctrl+x