- 安装:
yum install -y tree net-tools bind-utils tree sysstat vim-en* lrzsz NetworkManager-tui ntp ntpdate iftop tcpdump telnet traceroute
cat /etc/redhat-releasecat /etc/hostname
- 相当于 CentOS 6 的:service nginx stop
systemctl is-enabled iptables.service#查询服务是否开机启动systemctl enable iptables.service#开机运行服务systemctl disable iptables.service#取消开机运行systemctl start iptables.service#启动服务systemctl stop iptables.service#停止服务systemctl restart iptables.service#重启服务systemctl reload iptables.service#重新加载服务配置文件systemctl status iptables.service#查询服务运行状态systemctl --failed#显示启动失败的服务systemctl list-units --type=service#查看所有服务systemctl is-enabled httpd#查看httpd服务是否开机启动- 对于启动脚本的存放位置,也不再是
/etc/init.d/(这个目录也是存在的),而是/usr/lib/systemd/system/
- 关闭 firewall
systemctl stop firewalld.service#停止firewallsystemctl disable firewalld.service#禁止firewall开机启动
- 安装 iptables
- yum install -y iptables-services
- 启动 iptables
- systemctl restart iptables.service #最后重启防火墙使配置生效
- systemctl enable iptables.service #设置防火墙开机启动
- 其他使用照旧
- 查看网络配置:
ip a - 装回 ifconfig:
yum install -y net-tools
timedatectl set-timezone Asia/Shanghaitimedatectl status
