36

Has anyone figured out how to ftp a file down to a EC2 AMI using ubuntu on the command line?

I am able to connect to ftp.drupal.org (I'm trying to dowmload a Drupal module) and then I can't even execute a simple "ls" let alone a "get".

I just get the hideous "500 Illegal PORT command"

MadHatter
  • 78,442
  • 20
  • 178
  • 229
chuckboycejr
  • 511
  • 1
  • 4
  • 6
  • 3
    I'm voting to close this question as off-topic because it's an end-user question, not a sysadmin question. – Jenny D Mar 16 '15 at 11:34
  • 3
    This is the first Google result for "ftp illegal port command", I'd suggest moving the question instead of leaving it closed. – Carl Vitullo Jan 25 '17 at 19:30

1 Answers1

61

Linux command-line ftp defaults to using active-mode FTP. Try switching to passive mode with the pass command:

me@ip-10-a-b-c:~$ ftp ftp.drupal.org
Name (ftp.drupal.org:me): anonymous
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> dir
500 Illegal PORT command.
ftp: bind: Address already in use
ftp> pass
Passive mode on.
ftp> dir
227 Entering Passive Mode (140,211,166,134,86,192).
150 Here comes the directory listing.
lrwxrwxrwx    1 0        0              19 Apr 11  2009 debian -> ./pub/debian/debian
lrwxrwxrwx    1 0        0              20 Apr 11  2009 debian-cd -> ./pub/debian-cdimage
lrwxrwxrwx    1 0        0              20 Apr 11  2009 debian-cdimage -> ./pub/debian-cdimage
drwxr-xr-x    6 0        0            4096 Nov 20 16:38 pub
-rw-r--r--    1 0        0             819 Feb 03  2009 welcome.msg
226 Directory send OK.
MadHatter
  • 78,442
  • 20
  • 178
  • 229
  • 2
    You can type faster than I can. Looks like active/passive mismatch to me too. – Tonny Nov 20 '12 at 21:53
  • I'm receiving a 'passive mode refused' – Philippe Delteil Apr 02 '19 at 01:20
  • 1
    @PhilippeDelteil I'm sorry to hear it. You should write a new question showing us a *lot* more information about what you're doing, so we have some chance of being able to help. You should also link this question in it, to show that you've done some research. – MadHatter Apr 02 '19 at 06:24