FTPからダウンロードするとCurlがフリーズします。

FTPからダウンロードするとCurlがフリーズします。

次のコマンドを使用してFTPサーバーからファイルをダウンロードしようとしますcurl

curl --user kshitiz:pAssword ftp://@11.111.11.11/myfile.txt -o /tmp/myfile.txt -v

curlサーバーに接続して停止します。

* Hostname was NOT found in DNS cache
*   Trying 11.111.11.11...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0* Connected to 11.111.11.11 (11.111.11.11) port 21 (#0)
< 220-You Are Attempting To Access a Private
< 220-Network.  Unauthorized Access is Strictly
< 220-Forbidden.  Violators Will be Prosecuted!
< 220-- Management
< 220 This is a private system - No anonymous login
> USER kshitiz
< 331 User kshitiz OK. Password required
> PASS pAssword
< 230-OK. Current directory is /
< 230 4432718 Kbytes used (54%) - authorized: 8192000 Kb
> PWD
< 257 "/" is your current location
* Entry path is '/'
  0     0    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0> EPSV
* Connect data stream passively
* ftp_perform ends with SECONDARY: 0
  0     0    0     0    0     0      0      0 --:--:--  0:00:02 --:--:--     0< 229 Extended Passive mode OK (|||10653|)
* Hostname was NOT found in DNS cache
*   Trying 11.111.11.11...
* Connecting to 11.111.11.11 (11.111.11.11) port 10653
  0     0    0     0    0     0      0      0 --:--:--  0:00:03 --:--:--     0* Connected to 11.111.11.11 (11.111.11.11) port 21 (#0)
> TYPE A
  0     0    0     0    0     0      0      0 --:--:--  0:04:02 --:--:--     0^C

しかし、ftpファイルをリンクしてインポートするのはうまくいきます。

Status: Connecting to 11.1.1.11:21...
Status: Connection established, waiting for welcome message...
Response:   220-You Are Attempting To Access a Private
Response:   220-Network.  Unauthorized Access is Strictly
Response:   220-Forbidden.  Violators Will be Prosecuted!
Response:   220-- Management
Response:   220 This is a private system - No anonymous login
Command:    USER kshitiz
Response:   331 User kshitiz OK. Password required
Command:    PASS ******
Response:   230-OK. Current directory is /
Response:   230 4432718 Kbytes used (54%) - authorized: 8192000 Kb
Status: Server does not support non-ASCII characters.
Status: Connected
Status: Starting download of /myfile.txt
Command:    CWD /
Response:   250 OK. Current directory is /
Command:    PWD
Response:   257 "/" is your current location
Command:    TYPE I
Response:   200 TYPE is now 8-bit binary
Command:    PASV
Response:   227 Entering Passive Mode (10,9,4,66,39,139)
Command:    RETR myfile.txt
Response:   150 Accepted data connection
Response:   226-File successfully transferred
Response:   226 0.000 seconds (measured here), 3.39 Kbytes per second
Status: File transfer successful, transferred 1 B in 1 second

順序は何の関係ですかTYPE A? FTPが機能しているのに、なぜカールが機能しないのですか?

ベストアンサー1

--disable-epsvスイッチを追加すると問題が解決しました。

いくつかの説明:

私は奇妙なFTPの問題を解決しようとした時間を過ごしました。問題が発生する方法は、ログイン後にFTPクライアントがディレクトリ(または他のコマンド)を一覧表示しようとすると中断されることです。 EPSVは「拡張手動モード」であり、FTPの既存の手動モード(PASV)の新しい拡張です。最近のFTPクライアントは最初にEPSVを試み、失敗した場合は従来のPASVのみを使用します。 ...ファイアウォールがEPSVをブロックしている場合、クライアントはコマンドが成功したと見なします。そして続けて返事を待つ]。

もっと読むここ

おすすめ記事