防火墙相关命令
-
启动:
systemctl start firewalld
-
关闭:
systemctl stop firewalld
-
查看状态:
systemctl status firewalld
-
开机禁用 :
systemctl disable firewalld
-
开机启用 :
systemctl enable firewalld
端口相关命令
-
开放某个端口:
firewall-cmd --zone=public --add-port=80/tcp --permanent
(--permanent永久生效,没有此参数重启后失效) -
重新载入:
firewall-cmd --reload
-
查看:
firewall-cmd --zone= public --query-port=80/tcp
-
删除:
firewall-cmd --zone= public --remove-port=80/tcp --permanent
-
查看所有监听的端口:
netstat -lntp
-
查看具体某个端口是否被占用:
netstat -lnp|grep 8080
常用工具安装
-
安装net-tools
yum install net-tools
-
安装rsync:
yum -y install rsync
启动rsync服务:
systemctl start rsyncd.service
允许开机启动:systemctl enable rsyncd.service
检查是否已经成功启动:
netstat -lnp|grep 873
-
安装zip和unzip:
yum install -y unzip zip
修改相关命令
- 修改主机名:
hostnamectl set-hostname <host-name>
查看相关命令
- 查看内存使用情况:
free -m
-m表示的是单位是MB,可以是-g
网友评论