web-dev-qa-db-ja.com

無効なPORTコマンド。 -WinSCPを介した接続

Winscpを介してftpサーバーに接続しようとすると、最初に「Illegal port command」エラーが発生し、ルート(/)ディレクトリファイルを一覧表示しているときに発生していました。このエラーを取り除く方法がわかりません。ソーススクリプトをチェックしていますが(初期化スクリプトがあると想定しています)、探索する適切なソースまたはリンクが見つかりませんでした。

参照用にコピーされたログコンテキスト。

参考:FileZillaは問題なく正常に動作します。この問題に光を当ててください!

. 2018-01-08 08:57:09.656 --------------------------------------------------------------------------
. 2018-01-08 08:57:09.656 WinSCP Version 4.2.7 (Build 758) (OS 6.1.7601 Service Pack 1)
. 2018-01-08 08:57:09.656 Login time: Monday, January 08, 2018 8:57:09 AM
. 2018-01-08 08:57:09.656 --------------------------------------------------------------------------
. 2018-01-08 08:57:09.656 Session name: [email protected]
. 2018-01-08 08:57:09.656 Host name: myuploads.com (Port: 21)
. 2018-01-08 08:57:09.656 User name: test (Password: Yes, Key file: No)
. 2018-01-08 08:57:09.656 Tunnel: No
. 2018-01-08 08:57:09.656 Transfer Protocol: FTP
. 2018-01-08 08:57:09.656 Ping type: C, Ping interval: 30 sec; Timeout: 15 sec
. 2018-01-08 08:57:09.656 Proxy: none
. 2018-01-08 08:57:09.656 FTP: FTPS: Explicit TLS; Passive: No [Force IP: No]
. 2018-01-08 08:57:09.656 Local directory: C:\Users\Administrator\Documents, Remote directory: /, Update: Yes, Cache: Yes
. 2018-01-08 08:57:09.656 Cache directory changes: Yes, Permanent: Yes
. 2018-01-08 08:57:09.656 DST mode: 1
. 2018-01-08 08:57:09.656 --------------------------------------------------------------------------
. 2018-01-08 08:57:09.671 Connecting to myuploads.com ...
. 2018-01-08 08:57:09.671 m_pSslLayer changed state from 0 to 1
. 2018-01-08 08:57:09.671 m_pSslLayer changed state from 1 to 2
. 2018-01-08 08:57:09.671 m_pSslLayer changed state from 2 to 4
. 2018-01-08 08:57:09.671 Connected with myuploads.com, negotiating SSL connection...
< 2018-01-08 08:57:09.671 220 (vsFTPd 3.0.2)
> 2018-01-08 08:57:09.671 AUTH TLS
< 2018-01-08 08:57:09.671 234 Proceed with negotiation.
. 2018-01-08 08:57:09.827 SSL_connect: SSLv3 read server hello A
. 2018-01-08 08:57:09.827 SSL_connect: SSLv3 read server certificate A
. 2018-01-08 08:57:09.827 SSL_connect: SSLv3 read server key exchange A
. 2018-01-08 08:57:09.827 SSL_connect: SSLv3 read server certificate request A
. 2018-01-08 08:57:09.827 SSL_connect: SSLv3 read server done A
. 2018-01-08 08:57:09.827 SSL_connect: SSLv3 write client certificate A
. 2018-01-08 08:57:09.827 SSL_connect: SSLv3 write client key exchange A
. 2018-01-08 08:57:09.827 SSL_connect: SSLv3 write change cipher spec A
. 2018-01-08 08:57:09.827 SSL_connect: SSLv3 write finished A
. 2018-01-08 08:57:09.827 SSL_connect: SSLv3 flush data
. 2018-01-08 08:57:09.827 SSL_connect: SSLv3 read finished A
. 2018-01-08 08:57:09.827 Using TLSv1, cipher TLSv1/SSLv3: DHE-RSA-AES256-SHA, 2048 bit RSA
. 2018-01-08 08:57:09.827 SSL connection established. Waiting for welcome message...
> 2018-01-08 08:57:09.827 USER test
< 2018-01-08 08:57:09.827 331 Please specify the password.
> 2018-01-08 08:57:09.827 PASS ******
< 2018-01-08 08:57:09.858 230 Login successful.
> 2018-01-08 08:57:09.952 SYST
< 2018-01-08 08:57:09.952 215 UNIX Type: L8
> 2018-01-08 08:57:09.952 FEAT
< 2018-01-08 08:57:09.952 211-Features:
< 2018-01-08 08:57:09.952  AUTH TLS
< 2018-01-08 08:57:09.952  EPRT
< 2018-01-08 08:57:09.952  EPSV
< 2018-01-08 08:57:09.952  MDTM
< 2018-01-08 08:57:09.952  PASV
< 2018-01-08 08:57:09.952  PBSZ
< 2018-01-08 08:57:09.952  PROT
< 2018-01-08 08:57:09.952  REST STREAM
< 2018-01-08 08:57:09.952  SIZE
< 2018-01-08 08:57:09.952  TVFS
< 2018-01-08 08:57:09.952  UTF8
< 2018-01-08 08:57:09.952 211 End
> 2018-01-08 08:57:09.952 OPTS UTF8 ON
< 2018-01-08 08:57:09.952 200 Always in UTF8 mode.
> 2018-01-08 08:57:09.952 PBSZ 0
< 2018-01-08 08:57:09.952 200 PBSZ set to 0.
> 2018-01-08 08:57:09.952 PROT P
< 2018-01-08 08:57:09.952 200 PROT now Private.
. 2018-01-08 08:57:09.952 Connected
. 2018-01-08 08:57:09.952 Got reply 1 to the command 1
. 2018-01-08 08:57:09.952 --------------------------------------------------------------------------
. 2018-01-08 08:57:09.952 Using FTP protocol.
. 2018-01-08 08:57:09.952 Doing startup conversation with Host.
> 2018-01-08 08:57:09.952 PWD
< 2018-01-08 08:57:09.952 257 "/"
. 2018-01-08 08:57:09.952 Got reply 1 to the command 16
. 2018-01-08 08:57:09.952 Changing directory to "/".
> 2018-01-08 08:57:09.952 CWD /
< 2018-01-08 08:57:09.952 250 Directory successfully changed.
. 2018-01-08 08:57:09.952 Got reply 1 to the command 16
. 2018-01-08 08:57:09.952 Getting current directory name.
> 2018-01-08 08:57:09.952 PWD
< 2018-01-08 08:57:09.952 257 "/"
. 2018-01-08 08:57:09.952 Got reply 1 to the command 16
. 2018-01-08 08:57:09.952 Retrieving directory listing...
> 2018-01-08 08:57:09.952 TYPE A
< 2018-01-08 08:57:09.952 200 Switching to ASCII mode.
> 2018-01-08 08:57:09.952 PORT 10,0,40,181,244,221
< 2018-01-08 08:57:09.952 500 Illegal PORT command.
. 2018-01-08 08:57:09.952 Could not retrieve directory listing
. 2018-01-08 08:57:09.952 Got reply 4 to the command 2
. 2018-01-08 08:57:09.968 Retrieving directory listing...
> 2018-01-08 08:57:09.968 TYPE A
< 2018-01-08 08:57:09.968 200 Switching to ASCII mode.
> 2018-01-08 08:57:09.968 PORT 10,0,40,181,244,222
< 2018-01-08 08:57:09.968 500 Illegal PORT command.
. 2018-01-08 08:57:09.968 Could not retrieve directory listing
. 2018-01-08 08:57:09.968 Got reply 4 to the command 2
* 2018-01-08 08:57:09.968 (ECommand) Error listing directory '/'.
* 2018-01-08 08:57:09.968 Could not retrieve directory listing
* 2018-01-08 08:57:09.968 Illegal PORT command.
. 2018-01-08 08:57:27.159 Startup conversation with Host finished.
. 2018-01-08 08:57:27.798 Session upkeep
. 2018-01-08 08:57:28.313 Session upkeep
1
Avis

アクティブなFTPモードを使用するようにWinSCPを構成しました。

確かに、FileZillaではパッシブモードを使用しています。

WinSCPでパッシブモードを再度有効にしてください: https://winscp.net/eng/docs/ui_login_connection

アクティブ/パッシブモード に関するWinSCPの記事を読んで、アクティブモードが問題のある理由を理解してください。

1
Martin Prikryl