when I try to connect to FTP server as the following commands in debian while ufw is enabled
I got connected successfully
but I can't list the content of directories with the command ls , because it stuck on 150 Opening ASCII mode data connection.
But when I disable the ufw I got it working perfectly.
ftp ServerName.com
Connected to ServerName.com.
220 Microsoft FTP Service
331 Password required
Password:
230 User logged in.
Remote system type is Windows_NT.
ftp> ls
200 EPRT command successful.
150 Opening ASCII mode data connection.
the ufw config as the following
ufw status
Status: active
To Action From
-- ------ ----
22 ALLOW Anywhere
21/tcp ALLOW Anywhere
20/tcp ALLOW Anywhere
22 (v6) ALLOW Anywhere (v6)
21/tcp (v6) ALLOW Anywhere (v6)
20/tcp (v6) ALLOW Anywhere (v6)
Am I doing any thing wrong !! or what I have to add to the ufw to allow my ftp client to work as expected ?
As you have open already port 20 you can make ftp to use passive connection by enter command
pass
after you authenticate.