Centos 7.X 初始化配置

因为平时经常需要使用的是centos 7最小化安装,所以这里记录下在安装之后的初始配置


1、配置网络

修改配置文件:vi /etc/sysconfig/network-scrips/ifcfg-ens33

(需要查看自己的网关进行配置)

BOOTPROTO=none
DEVICE=ens33
ONBOOT=yes
IPADDR=192.168.1.3
PREFIX=24
GATEWAY=192.168.1.2

修改dns解析文件:

vi /etc/resolv.conf
nameserver 8.8.8.8

重启网络:service network restart

安装网络工具:yum insatll net-tools

然后通过:ifconfig 查看网络配置成功


2、配置源

yum install wget vim -y

配置网易源:

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS6-Base-163.repo

配置阿里云:

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

生成缓存:

yum makecache

3、安装yum的优先级插件

yum install yum-plugin-priorities -y

4、关闭 SELinux 和 防火墙

sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/sysconfig/selinux
setenforce 0

查看SELinux状态:sestatus

关闭防火墙:

systemctl status firewalld
systemctl stop firewalld
systemctl disable firewalld
systemctl status firewalld
firewall-cmd --state

5、epel源

yum install epel-release

查看repo情况:

yum repolist

6、同步时间

yum install ntp

systemctl enable ntpd.service
systemctl start ntpd.service

手工同步时间

ntpdate 0.centos.pool.ntp.org

7、修改主机名 域名解析

8、重启主机 reboot

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值