title: Having trouble with LFTP. Socket error when Connecting to Firezilla
body: <p>I have a bash script that I am trying to run on my hostgator account. </p>
  
  <pre><code>cd $HOMEDIR
  dir="$(date +'%a')"
  
  # Upload backups (5 tries)
  i=0
  while [ $i -le 5 ]; do
    # We're running this more than once so it's advised to use -E to delete the
    # original file after successful transfer.
      lftp -d -e "set ftp:ssl-allow no; mrm backup-*.tar.gz; mput -c -E -O $dir backup-*.tar.gz;quit" -u $FTP_USER,$FTP_PASS -p $FTP_PORT $FTP_ADDR
  
      sleep 5
      ((i++))
  done
  
  # Delete backup before generating new b/c hostgator allows only one
  rm backup-*.tar.gz
  
  # Generate new full backup in Cpanel
  PARAMS="dest=homedir&amp;email=$EMAIL&amp;submit=Generate%20Backup"
  curl -u $CPANEL_USER:$CPANEL_PASS --data $PARAMS $CPANEL_HOST/frontend/x3/backup/dofullbackup.html
  </code></pre>
  
  <p>The above script leaves me with the error code below from the client side (hostgator):</p>
  
  <pre><code>---&gt; FEAT
  &lt;--- 211-Features:                                                
  &lt;---  MDTM
  &lt;---  REST STREAM
  &lt;---  SIZE
  &lt;---  MLST type*;size*;modify*;
  &lt;---  MLSD
  &lt;---  AUTH SSL
  &lt;---  AUTH TLS
  &lt;---  PROT
  &lt;---  PBSZ
  &lt;---  UTF8
  &lt;---  CLNT
  &lt;---  MFMT
  &lt;---  EPSV
  &lt;---  EPRT
  &lt;--- 211 End
  ---&gt; CLNT lftp/4.0.9
  &lt;--- 200 Don't care                                         
  ---&gt; OPTS UTF8 ON
  &lt;--- 202 UTF8 mode is always enabled. No need to send this command.
  ---&gt; USER emre**
  &lt;--- 331 Password required for emre**                   
  ---&gt; PASS *******
  &lt;--- 230 Logged on                                                
  ---&gt; PWD
  &lt;--- 257 "/" is current directory.                                    
  ---&gt; TYPE I
  &lt;--- 200 Type set to I                                                
  ---&gt; SIZE Fri/backup-6.17.2016_08-40-54_emre.tar.gz
  &lt;--- 550 File not found                                               
  ---&gt; PASV
  &lt;--- 227 Entering Passive Mode (**,***,**,**,199,56)                  
  ---- Connecting data socket to (**.***.**.**) port 51000
  **** Socket error (Connection refused) - reconnecting
  ---- Closing data socket
  ---- Closing control socket
  </code></pre>
  
  <p>The server system is firezilla running on windows 10.</p>
  
  <pre><code>(000017)6/17/2016 19:01:11 PM - (not logged in) (***.***.***.**)&gt; Connected on port 2222, sending welcome message...
  (000017)6/17/2016 19:01:11 PM - (not logged in) (***.***.***.**)&gt; 220-FileZilla Server 0.9.57 beta
  (000017)6/17/2016 19:01:11 PM - (not logged in) (***.***.***.**)&gt; 220-written by Tim Kosse (tim.kosse@filezilla-project.org)
  (000017)6/17/2016 19:01:11 PM - (not logged in) (***.***.***.**)&gt; 220 Please visit https://filezilla-project.org/
  (000017)6/17/2016 19:01:11 PM - (not logged in) (***.***.***.**)&gt; FEAT
  (000017)6/17/2016 19:01:11 PM - (not logged in) (***.***.***.**)&gt; 211-Features:
  (000017)6/17/2016 19:01:11 PM - (not logged in) (***.***.***.**)&gt;  MDTM
  (000017)6/17/2016 19:01:11 PM - (not logged in) (***.***.***.**)&gt;  REST STREAM
  (000017)6/17/2016 19:01:11 PM - (not logged in) (***.***.***.**)&gt;  SIZE
  (000017)6/17/2016 19:01:11 PM - (not logged in) (***.***.***.**)&gt;  MLST type*;size*;modify*;
  (000017)6/17/2016 19:01:11 PM - (not logged in) (***.***.***.**)&gt;  MLSD
  (000017)6/17/2016 19:01:11 PM - (not logged in) (***.***.***.**)&gt;  AUTH SSL
  (000017)6/17/2016 19:01:11 PM - (not logged in) (***.***.***.**)&gt;  AUTH TLS
  (000017)6/17/2016 19:01:11 PM - (not logged in) (***.***.***.**)&gt;  PROT
  (000017)6/17/2016 19:01:11 PM - (not logged in) (***.***.***.**)&gt;  PBSZ
  (000017)6/17/2016 19:01:11 PM - (not logged in) (***.***.***.**)&gt;  UTF8
  (000017)6/17/2016 19:01:11 PM - (not logged in) (***.***.***.**)&gt;  CLNT
  (000017)6/17/2016 19:01:11 PM - (not logged in) (***.***.***.**)&gt;  MFMT
  (000017)6/17/2016 19:01:11 PM - (not logged in) (***.***.***.**)&gt;  EPSV
  (000017)6/17/2016 19:01:11 PM - (not logged in) (***.***.***.**)&gt;  EPRT
  (000017)6/17/2016 19:01:11 PM - (not logged in) (***.***.***.**)&gt; 211 End
  (000017)6/17/2016 19:01:11 PM - (not logged in) (***.***.***.**)&gt; CLNT lftp/4.0.9
  (000017)6/17/2016 19:01:11 PM - (not logged in) (***.***.***.**)&gt; 200 Don't care
  (000017)6/17/2016 19:01:11 PM - (not logged in) (***.***.***.**)&gt; OPTS UTF8 ON
  (000017)6/17/2016 19:01:11 PM - (not logged in) (***.***.***.**)&gt; 202 UTF8 mode is always enabled. No need to send this command.
  (000017)6/17/2016 19:01:11 PM - (not logged in) (***.***.***.**)&gt; USER emre**
  (000017)6/17/2016 19:01:11 PM - (not logged in) (***.***.***.**)&gt; 331 Password required for emre**
  (000017)6/17/2016 19:01:11 PM - (not logged in) (***.***.***.**)&gt; PASS ********
  (000017)6/17/2016 19:01:11 PM - emre** (***.***.***.**)&gt; 230 Logged on
  (000017)6/17/2016 19:01:11 PM - emre** (***.***.***.**)&gt; PWD
  (000017)6/17/2016 19:01:11 PM - emre** (***.***.***.**)&gt; 257 "/" is current directory.
  (000017)6/17/2016 19:01:11 PM - emre** (***.***.***.**)&gt; PASV
  (000017)6/17/2016 19:01:11 PM - emre** (***.***.***.**)&gt; 227 Entering Passive Mode (76,100,88,71,199,56)
  (000017)6/17/2016 19:01:11 PM - emre** (***.***.***.**)&gt; LIST
  (000017)6/17/2016 19:01:11 PM - emre** (***.***.***.**)&gt; ABOR
  (000017)6/17/2016 19:01:11 PM - emre** (***.***.***.**)&gt; 226 ABOR command successful
  (000017)6/17/2016 19:01:11 PM - emre** (***.***.***.**)&gt; disconnected.
  </code></pre>
  
  <p>I don't know what is going on? Can anyone send some light? I've been digging for hours now and cannot figure it out. </p>