防火墙
systemctl stop firewalld.service #关闭firewall
systemctl disable firewalld.service #禁止firewall开机启动
Selinux
#关闭SELINUX vi /etc/selinux/config #SELINUX=enforcing 替换 SELINUX=disabled :wq! #保存退出 setenforce 0 #使配置立即生效
修改时区
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
修改网卡名称
#1、修改网卡名称 cd /etc/sysconfig/network-scripts/ mv ifcfg-eno16777736 ifcfg-eth0 #2、修改网卡配置文件 cat /etc/sysconfig/network-scripts/ifcfg-eth0 TYPE=Ethernet BOOTPROTO=static NETMASK=255.255.255.0 IPADDR=10.0.0.110 GATEWAY=10.0.0.2 DEFROUTE=yes PEERDNS=yes PEERROUTES=yes IPV4_FAILURE_FATAL=no NAME=eth0 UUID=582bec32-fa8b-415e-9cdc-873035dc336d DEVICE=eth0 ONBOOT=yes #3、修改grub 加入以下内容(红色部分) cat /etc/sysconfig/grub GRUB_TIMEOUT=5 GRUB_DISTRIBUTOR="$(sed ‘s, release .*$,,g‘ /etc/system-release)" GRUB_DEFAULT=saved GRUB_DISABLE_SUBMENU=true GRUB_TERMINAL_OUTPUT="console" GRUB_CMDLINE_LINUX="rhgb net.ifnames=0 biosdevname=0 quiet" GRUB_DISABLE_RECOVERY="true" #4、生成启动菜单 grub2-mkconfig -o /boot/grub2/grub.cfg #5、重启系统 reboot
关闭邮件服务
systemctl stop postfix.service
systemctl enable postfix.service
查看启动项
CentOS7已不再使用chkconfig 管理启动项,使用 systemctl list-unit-files 可以查看启动项 [[email protected]-node1 ~]# systemctl list-unit-files UNIT FILE STATE tmp.mount disabled brandbot.path disabled session-1.scope static arp-ethers.service disabled auditd.service enabled [[email protected]-node1 ~]# systemctl list-unit-files |grep enabled auditd.service enabled [email protected] enabled chronyd.service enabled crond.service enabled
同步时间
检查是否安装ntp [[email protected]-node1 ~]# rpm -q ntp ntp-4.2.6p5-25.el7.centos.2.x86_64 如果已经安装则略过此步,否则使用yum进行安装,并设置系统开机自动启动并启动服务 [[email protected]-node1 ~]# yum -y install ntp [[email protected]-node1 ~]# systemctl start ntpd [[email protected]-node1 ~]# systemctl enable ntpd [[email protected]-node1 ~]# /usr/sbin/ntpdate time.nist.gov 24 Aug 17:21:43 ntpdate[2741]: the NTP socket is in use, exiting [[email protected]-node1 ~]# date Thu Aug 24 17:21:46 CST 2017