CentOS7最小化安装后的操作

1.检查网卡是否启用(可用ip addr查看ip)

2.安装基本命令

yum search ifconfig //查看ifconfig命令所在的包
yum install -y wget
yum install -y net-tools
yum install -y unzip zip //压缩和解压

3.更换yum源

#163源
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo
#or 阿里源
cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
cp /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.bak
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
#禁用 yum插件 fastestmirror
vi /etc/yum/pluginconf.d/fastestmirror.conf  
enabled = 1 #由1改为0,禁用该插件
vi /etc/yum.conf
plugins=1 #由1改为0,不使用插件
#清除缓存
yum clean all
#重建源数据缓存 
yum makecache
#ok,换源完成

4.更换防火墙

#注意有时会发生即使禁用了也只有22端口能访问。这时需要启动firewalld服务添加相应端口。
#https://blog.csdn.net/lcyong_/article/details/78928223
systemctl stop firewalld
systemctl disable firewalld.service
yum install -y iptables-services

5.配置ipables

6.关闭SELINUX

vi /etc/selinux/config
#注释掉下面两行 
#SELINUX=enforcing 
#SELINUXTYPE=targeted 
#增加一行 
SELINUX=disabled

然后使用下面的命令启用,在这里最好重启一下系统,也可以稍后重启

setenforce 0
posted @ 2019-01-22 20:53  bhoold  阅读(289)  评论(0编辑  收藏  举报