删除命令
Rm -rf 目录名字
-r 就是向下递归,不管有多少级目录,一并删除
-f 就是直接强行删除,不作任何提示的意思
Linux firewalld开放端口
firewall-cmd --zone=public --add-port=3690/tcp --permanent
firewall-cmd--reload
关闭Linux的firewalld,启动以前的iptables防火墙
把Centos7自带的防火墙firewalld关闭,然后开启之前的版本iptables。
systemctl stop firewalld //关闭firewalld服务
systemctl disable firewalld //禁止firewalld服务开机启动
yum install -y iptables-services //安装iptables-services
systemctl enable iptables //让它开机启动
systemctl start iptables //启动iptables
现在就可以 使用之前版本的iptables了。CentOS上默认有iptables规则,这个规则虽然很安全,但对于我们来说没有用,反而会造成某些影响,所以建议先清除规则,然后把清除的规则保存一下。
iptables -nvL
iptables -F;service iptables save
-nvL选项表示查看规则,-F选项表示清除当前规则,但清除只是临时的,启动系统或者重启iptables服务后还会加载已经保存的规则,所以需要使用service iptables save保存一下规则。通过上面的命令输出,可以看到,防火墙的规则保存在/etc/sysconfig/iptables中。
开放Linux的对外访问的端口8080
iptables -I INPUT -p tcp --dport 8080 -j ACCEPT
iptables -I OUTPUT -p tcp --dport 8080 -j ACCEPT
service iptables save
firewall开放端口
firewall-cmd --zone=public --add-port=80/tcp--permanent
查看firewalld端口状态
netstat -tunlp
centos查看端口占用情况
netstat -anltup | grep 80
查找路径
find / -name svn