1、操作区别
1.1 防火墙
1.1.1 CentOS6 iptables
- 开启/重启防火墙
service iptables start/restart
- 查看防火墙的状态
service iptables status
- 临时关闭防火墙
service iptables stop
1.1.2 CentOS7 firewalld
- 查看防火墙的状态
systemctl status firewalld.service
- 临时关闭防火墙
systemctl stop firewalld.service
- 永久关闭防火墙
system disable firewalld.service
1.2 主机名
1.2.1 CentOS6
/etc/sysconfig/network
1.2.2 CentOS7
/etc/hostname
修改主机名:hostnamectl set-hostname xxxx
1.3 服务相关
1.3.1 CentOS6 启动/重启、停止、状态
service xxxxx start/restart
service xxxxx stop
service xxxxx status
1.3.2 CentOS7 启动/重启、停止、状态
systemctl start/restart xxxxx
systemctl stop xxxxx
systemctl status xxxxx
1.3.3 CentOS6 开机启动/关闭
chkconfig xxxxx on/off
1.3.4 CentOS7 开机启动/关闭
systemctl enable/disable xxxxx