OS I'am using CentOS 6.10
I am trying to configure active mode ftp by opening port 20 and 21 only. (Exactly I don't no how to configure active mode ftp)
This is my iptables rule.
[root@server ~]# iptables -L -n Chain INPUT (policy DROP) target prot opt source destination ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:22 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:21 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:20 Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination
And I added pasv_enable=NO
in /etc/vsftpd/vsftod.conf file
If I try to access ftp server using ftp
command I am able to access.
max@client:~$ ftp 192.168.43.5 Connected to 192.168.43.5. 220 (vsFTPd 2.2.2) Name (192.168.43.5:suraj): ftp 331 Please specify the password. Password: 230 Login successful. Remote system type is UNIX. Using binary mode to transfer files. ftp> ls 200 PORT command successful. Consider using PASV. 150 Here comes the directory listing. drwxr-xr-x 3 0 0 4096 Dec 28 07:50 pub 226 Directory send OK. ftp> cd pub 250 Directory successfully changed. ftp> ls 200 PORT command successful. Consider using PASV. 150 Here comes the directory listing. drwxr-xr-x 2 0 0 4096 Dec 28 07:51 data 226 Directory send OK. ftp> cd data 250 Directory successfully changed. ftp> ls 200 PORT command successful. Consider using PASV. 150 Here comes the directory listing. -rw-r--r-- 1 0 0 1796 Dec 28 07:51 file.txt 226 Directory send OK. ftp> get file.txt local: file.txt remote: file.txt 200 PORT command successful. Consider using PASV. 150 Opening BINARY mode data connection for file.txt (1796 bytes). 226 Transfer complete. 1796 bytes received in 0.00 secs (3780.0 kB/s) ftp>
If I try to access ftp using browser I am unable to access.
To open ftp content in browser what need to change ?
550 Permission denied
error coming.iptables
rule in answer section.