I just tried to transfer a plugin to my server using FTP, but kept getting Connection Refused whenever I logged in. My hosting provider’s solution was to reboot my VPS – a little problematic as I was in the middle of editing httpd.conf, so now my HTTP access is hosed :-( The FTP server started working though :-)

Here’s what you should do to test your FTP server

  1. Open a command prompt
  2. Start a telnet session by typing telnet mydomain ftp then type the items entered in BOLD below
  3. connecting to mydomain…
    220 mydomain FTP server (Version wu-2.6.2(1) Mon Aug 16 17:10:57 IDT 2004) ready.
    150 Opening BINARY mode data connection for file list.
    226 Transfer complete.
    USER anonymous
    331 Guest login ok, send your complete e-mail address as password.
    PASS mozilla@
    230 Guest login ok, access restrictions apply.
    SYST
    215 UNIX Type: L8
    TYPE I
    200 Type set to I.
    PASV
    227 Entering Passive Mode (192,168,0,10,239,190)
    NLST

    Do not worry if you get the reply 550 *: No such file or directory

  4. Start another command prompt
  5. Start another telnet session, but this time use the data received in reply to the PASV command above. In our example, the FTP server at IP Address 192.168.0.10 is listening on port ((239* 256) + 190), or 61374, so we would type telnet mydomain 61374
  6. If you received error 550, then type LIST in the first telnet session and you will see a list of files appear in the second telnet window and a couple of messages in the first window

    150 Opening BINARY mode data connection for /bin/ls.
    226 Transfer complete.

    If you did not receive error 550, then you will see a list of the directories appear in the second telnet window, followed by Connection to host lost and the two messages below in the first telnet window. There will be a pause between the first and second message while the data is transmitted.

    150 Opening BINARY mode data connection for file list.
    226 Transfer complete.

  7. Type QUIT in the first telnet window to close the FTP session. You may need to type QUIT again to terminate the telnet session.

If you like, you can edit /etc/ftpaccess and remove the ‘#’ from the two lines
#log commands real
#log transfers anonymous,real inbound,outbound

to enable logging for your FTP server. Beware as these log files can suck up disk space! Look here for full details, or do a Google on “log commands real” wu-ftp

Bookmark this article