KVM虚拟机部署centos7.9模板

配置模板系统 更换换阿里云yum源和阿里开源镜像提供的epel源 rm -rf /etc/yum.repos.d/* # 删除原yum源 #wget命令下载Centos-7.repo wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirr

配置模板系统

更换换阿里云yum源和阿里开源镜像提供的epel源


rm -rf /etc/yum.repos.d/*  # 删除原yum源
 
#wget命令下载Centos-7.repo 
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
 
yum install -y epel-release
 
#wget命令下载阿里云源epel.repo 
wget -O /etc/yum.repos.d/epel-7.repo http://mirrors.aliyun.com/repo/epel-7.repo

安装常用工具

yum install -y bash-completion.noarch net-tools vim lrzsz wget tree screen lsof tcpdump sysstat ntpdate unzip dos2unix curl 

设置时区

timedatectl set-timezone Asia/Shanghai
ntpdate ntp1.aliyun.com

关闭防火墙

systemctl stop firewalld.service
systemctl disable firewalld.service

关闭Selinux


vi /etc/selinux/config  #重启生效

7 SELINUX=disabled  #第七行

网卡配置优化


systemctl stop NetworkManager
 
cat /etc/sysconfig/network-scripts/ifcfg-eth0 
 
TYPE=Ethernet
BOOTPROTO=none
NAME=eth0
DEVICE=eth0
ONBOOT=yes
IPADDR=x.x.x.x  
NETMASK=255.255.255.0
GATEWAY=x.x.x.x
DNS1=223.5.5.5
DNS2=8.8.8.8

SSH优化

配置文件
vim /etc/ssh/sshd_config
 
115 #UseDNS no
改为:  UseDNS no
 
79 GSSAPIAuthentication yes
改为: GSSAPIAuthentication no

Comment