Unable to connect via FTP

Support for security such as Firewalls and securing linux
Post Reply
CallumLord
Posts: 2
Joined: 2020/04/15 13:06:44

Unable to connect via FTP

Post by CallumLord » 2020/04/15 13:32:57

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

User avatar
TrevorH
Forum Moderator
Posts: 28594
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Unable to connect via FTP

Post by TrevorH » 2020/04/15 13:57:35

What sort of firewall are you runnning? Is it firewalld or iptables? How did you open the ftp ports?
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

CallumLord
Posts: 2
Joined: 2020/04/15 13:06:44

Re: Unable to connect via FTP

Post by CallumLord » 2020/04/15 15:52:41

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

User avatar
TrevorH
Forum Moderator
Posts: 28594
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Unable to connect via FTP

Post by TrevorH » 2020/04/15 19:06:20

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.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

Post Reply

Return to “CentOS 7 - Security Support”