Netizens may be using the FTP dir or LS command to view the file list, but can not see, is restricted, then cannot view the file list this caused us a lot of trouble, then how to solve this problem! Now let's have a look!
In the command line mode of the Win7 system, the dir or LS command using FTP cannot view the list of files, but it can be viewed using IE. After finding the relevant information, it boils down to two reasons:
Problem with Permissions
Windows comes with firewall blocking
After the experiment found that my situation belongs to the second type, the specific solution has the following several:
Shut down Windows Firewall directly
Turn on the firewall, but set the inbound rule to allow the Ftp.exe program to receive information
To set a rule by using the Netsh command
[Plain]
netsh advfirewall firewall add rule name= "FTP (NON-SSL)" program= "%systemroot%system32ftp.exe" Action=allow protocol= TCP Dir=in
netsh advfirewall set global statefulftp disable
Command 1 works the same as the second method
Command 2 is mainly used to prohibit statefulftp filtering, this article does not affect me, but it is recommended to add
Small episode
Here we refer to two related articles, using two similar but different commands, respectively.
[Plain]
Article 1
netsh advfirewall firewall add rule name= "FTP (NON-SSL)" Action=allow protocol=tcp dir=in localport=21
netsh advfirewall set global statefulftp Enable
[Plain]
Article 2
netsh advfirewall firewall add rule name= "FTP Service" Action=allow service=ftpsvc protocol=tcp dir=in
netsh advfirewall set global statefulftp disable
It is so tangled, for the article localport=21 always can not correspond to the Windows Ftp.exe program, and later use the tasklist command to find the corresponding PID number of FTP,
Then through the command netstat found that ftp.exe on their own computer on the original port is not 21.
And the article Service=ftpsvc also can not allow the exception of Ftp.exe, and later help the following Netsh command, found the program parameters, only to add the application path.