天天看點

真正解決辦法:FTP 執行指令時500 Illegal PORT command

遠端登入到伺服器,執行dir/ls等指令,一律是:

ftp> ls
500 Illegal PORT command.
ftp> dir
500 Illegal PORT command.      

伺服器有問題?上網搜尋,很多人都人雲亦雲,自己都沒試用。找了半天,終于找到了一個解決辦法。即使用quote/passive更改模式:

ftp> quote pasv
227 Entering Passive Mode (192,168,2,2,1111,5555)
ftp> passive
Passive mode on.
ftp> dir
227 Entering Passive Mode (192,168,2,3,117,56)
150 Here comes the directory listing.
drwxr-xr-x    9 0        0             220 Sep 16  2019 apache-tomcat-8.5.46
drwxr-x---    3 0        0              18 Nov 20  2020 apache-tomcat-home
drwxr-xr-x    9 0        0             202 Aug 19  2020 apache-tomcat-plugin_test
drwxr-xr-x    9 0        0             220 Jul 03  2020 apache-tomcat-reader
drwxrwxr-x    9 1123     1123          220 Aug 12  2020 apache-tomcat-temp-test
drwxr-xr-x    9 0        0             220 Jul 03  2020 apache-tomcat-upgrade
drwxr-x---    3 0        0              18 Nov 20  2020 apache-tomcat-wo
226 Directory send OK.

      

繼續閱讀