Failed FTP upload: 521 PROT P required

Thursday, September 1, 2011 13:21
Posted in category Administrador Sistemas

Intentando conectarme a un servidor FTP seguro mediante el comando curl recibí el siguiente mensaje de error: “PROT P required”.
Aquí podemos ver los logs del intento de conexión:

< 220 Welcome to XXXXX.
> USER usuario
< 331 Password required for usuario
> PASS YYYYY
< 230 Logged on
> PBSZ 0
< 200 PBSZ=0
> PWD
< 257 "/" is current directory.
* Entry path is '/'
> CWD IN
< 250 CWD successful. "/IN" is current directory.
> EPSV
* Connect data stream passively
< 229 Entering Extended Passive Mode (|||2191|)
*   Trying YYY.XXX.ZZZ.YYY... connected
* Connecting to YYY.XXX.ZZZ.YYY (YYY.XXX.ZZZ.YYY) port 2191
> TYPE I
< 200 Type set to I
> STOR fichero_prueba.txt
< 521 PROT P required
* Failed FTP upload: 521
* Remembering we are in dir "IN/"
* Uploaded unaligned file size (0 out of 33 bytes)
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0* 
Connection #0 to host XXXX.XXX.net left intact
 
curl: (25) Failed FTP upload: 521

Para solucionarlo hay que indicarle al comando curl que envie el comando PROT P. Esto se indica pasándole al comando curl el parámetro Q como se puede ver a continuación:

curl   -vk  -T fichero_prueba.txt  
-u cust-usuario:password ftpS://YYY.XXXX.net:PORT/ruta/ 
--ftp-pasv  
-Q "prot p"
You can leave a response, or trackback from your own site.

Leave a Reply