我是Debian的新手。我已经在Debian 6(系统的http服务器是Nginx)上打开了ftp端口(21)。我如何通过服务或以某种方式停止或禁用端口?命令/etc/init.d/proftpd stop不起作用,它在控制台bash: /etc/init.d/proftpd: No such file or directory中显示,因为proftpd不存在。
/etc/init.d/proftpd stop
bash: /etc/init.d/proftpd: No such file or directory
proftpd
7gs2gvoe1#
如果您懒得让服务停止运行,您可以编写一个iptabLes规则
sbin/iptables -A INPUT -p tcp --destination-port {PORT-NUMBER-HERE} -j DROP
bxpogfeg2#
输入此命令netstat -tnlp,您可以找到哪个进程正在端口21上运行。
netstat -tnlp
那你就可以自己干点活了。
2条答案
按热度按时间7gs2gvoe1#
如果您懒得让服务停止运行,您可以编写一个iptabLes规则
bxpogfeg2#
输入此命令
netstat -tnlp
,您可以找到哪个进程正在端口21上运行。那你就可以自己干点活了。