centos7系統安裝完成初始化

1、關閉selinux

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

2、關閉防火牆

systemctl disable firewalld
systemctl stop firewalld

3、關閉NetworkManager

systemctl disable NetworkManager
systemctl stop NetworkManager

4、配置IP地址

vim /etc/sysconfig/network-scripts/ifcfg-ens33

5、配置DNS地址

vim /etc/resolv.conf
nameserver 114.114.114.114

6、修改主機名:

hostnamectl set-hostname HOST-NAME
hostname HOST-NAME

vim /etc/hostname
HOST-NAME

7、修改hosts文件

vim /etc/hosts
127.0.0.1 HOST-NAME
IP HOST-NAME

8、更新Yum源

cd /etc/yum.repos.d/
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
sed -i '/aliyuncs/d' CentOS-Base.repo
yum clean all
yum makecache

9、安裝常用工具

yum install -y vim net-tools bind-utils lrzsz wget sysstat iotop iftop nc

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章