Answer the question
In order to leave comments, you need to log in
How to close port 21?
I use sftp but the pentest shows that port 21 is open. What is the best way to close, through iptables or by stopping the ftp service? In the case of a reboot, will it rise again and be opened? What's the best way to do it?
Answer the question
In order to leave comments, you need to log in
SFTP and FTP are two different protocols. The first works via ssh on port 22, and the second on port 21. If no one needs port 21, then it should be closed or even deleted the ftp server
If you do not need ftp, of course, it is best to remove or at least disable it.
Add an appropriate rule to the IPTables firewall.iptables -A INPUT -p tcp --dport 21 -j DROP
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question