Page 1 of 1

Unable to connect via FTP

Posted: 2020/04/15 13:32:57
by CallumLord
Hi Guy's,

I'm having some issues when trying to connect via FTP using FileZilla. SFTP works however when trying to connect with normal FTP on port 21 it just sits trying to connect, I'm thinking this could be a firewall possibly? Any ideas?

Thanks

Re: Unable to connect via FTP

Posted: 2020/04/15 13:57:35
by TrevorH
What sort of firewall are you runnning? Is it firewalld or iptables? How did you open the ftp ports?

Re: Unable to connect via FTP

Posted: 2020/04/15 15:52:41
by CallumLord
Hi Trevor,

I haven't installed any firewalls I'd imagine it would be the inbuilt one.

I opened this using firewall-cmd –zone=public –add-port=21/tcp –permanent

Re: Unable to connect via FTP

Posted: 2020/04/15 19:06:20
by TrevorH
The install will have installed firewalld for you and out of the box it is configured to only allow ssh. The command you ran to enable ftp port 21 is not the correct one as ftp is a weird protocol that uses that port and port 20 and many random ports. To handle that it needs a kernel module to track them. So undo the port 21/tcp change you made and redo it using --add-service=ftp and it will do that for you. Always use the service file if it exists as it may do other things than just open a single port.