基本优化
#临时关闭selinux
setenforce 0
#关闭防火墙
systemctl stop firewalld
#关闭开机自启
systemctl disable firewalld
#关闭邮件服务
systemctl stop postfix.service
#关闭开机自启
systemctl disable postfix.service
#关闭centos8的网卡服务
systemctl stop NetworkManager
#关闭开启自启
systemctl disable NetworkManager
=======================================================
setenforce 0
systemctl stop firewalld
systemctl disable firewalld
systemctl stop postfix.service
systemctl disable postfix.service
systemctl stop NetworkManager
systemctl disable NetworkManager
源优化
#bese源
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
#epel源
curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
#更换完别忘记加载一下
yum clean all
yum makecache
=======================================================
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
yum clean all
yum makecache
运维常用软件下载
yum install -y tree vim net-tools lrzsz wget telnet bash-completion unzip
远程连接优化
#提高远程连接效率
sed -i '79s#yes#no#g' /etc/ssh/sshd_config
sed -i 's@#UseDNS yes@UseDNS no@g' /etc/ssh/sshd_config
时间同步优化
#修改系统时区
timedatectl set-timezone Asia/Shanghai
#开启网络时间同步功能
timedatectl set-ntp 1
#安装时间同步程序
yum install -y chrony
systemctl start chronyd
systemctl enable chronyd
=======================================================
timedatectl set-timezone Asia/Shanghai
timedatectl set-ntp 1
yum install -y chrony
systemctl start chronyd
systemctl enable chronyd
颜色提示符优化
#可以让主机名颜色变的醒目
vi /etc/profile
User_color='\[\e[34;1m\]'
Hostname_color='\[\e[32;1m\]'
Path_color='\[\e[31;1m\]'
End_color='\[\e[0m\]'
PS1="[${User_color}\u${End_color}@${Hostname_color}\h${End_color}${Path_color}\W${End_color}]\\$ "
#wq!保存
#加载环境变量
source /etc/profile
=======================================================
30: 灰色
31: 红色
32: 绿色
33: 黄色
34: 蓝色
35: 粉色
36: 浅蓝色
37: 白色
#可以通过修改上方变量中的数字来修改颜色
网友评论