Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.4: Fix a command-line FTP problem with IPv4 servers UNIX
Tiger only hintI sometimes use the command-line FTP program that's included with Mac OS X to upload files to my ISP. Since Tiger was released, I have had problems. The login process always works fine, but when I try to do a dir command, for example, the program stalls and I never get the results.

For a while I suspected my Linksys router to be the problem. But I tried the same FTP commands on a Linux box I have, and everything worked fine. So it really is a Tiger issue.

After some investigation, I found that Tiger's FTP program has an option set by default: EPSV/EPRT on IPv4. To disable this, you must issue the epsv4 command in the FTP program before doing anything else. From now on, any command will work correctly and as expected.

[kirkmc adds: The man page for the ftp command mentions this option and command. It seems that the option exists in Panther, but was not enabled by default.]
    •    
  • Currently 3.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)
 
[11,631 views]  

10.4: Fix a command-line FTP problem with IPv4 servers | 9 comments | Create New Account
Click here to return to the '10.4: Fix a command-line FTP problem with IPv4 servers' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.4: Fix a command-line FTP problem with IPv4 servers
Authored by: Pedro Estarque on Apr 26, '06 10:42:50AM

Using the -A flag ( active instead of standard passive ) solved many issues of unresponsive servers. YMMV



[ Reply to This | # ]
10.4: Fix a command-line FTP problem with IPv4 servers
Authored by: gxw on Apr 26, '06 07:38:59PM

Curious....
Do you have FTP PASV mode enabled on your network card?
Have not tested but turning this off may work.
go to network card - setup - proxies



[ Reply to This | # ]
10.4: Fix a command-line FTP problem with IPv4 servers
Authored by: Pedro Estarque on Apr 27, '06 08:21:10AM

Yep, "Use Passive FTP Mode (PASV)" is ticked on by default. 10.4.6 from fresh install on a PowerBook 12" 1Ghz



[ Reply to This | # ]
10.4: Fix a command-line FTP problem with IPv4 servers
Authored by: bigkm on Apr 27, '06 01:19:14AM

ahhh thanks.
I've tried everything (well except that), it's been so annoying, i couldn't even ftp into my mini.

Thankyou.



[ Reply to This | # ]
Use sftp instead?
Authored by: adrianm on Apr 27, '06 06:38:39AM
As an alternative, you might want to use sftp instead. It's secure (just need to open the secure shell access in Sharing prefs) and for the most part, just as useful.

Doesn't help if you have to connect to an FTP service, of course, but if you own both ends, it's a better alternative IMO.

[ Reply to This | # ]

Also: System Preferences -> Sharing -> Services -> FTP Access (checked)
Authored by: rjamest on Apr 27, '06 07:59:26AM

I had a devil of a time using any FTP program (CLI, DreamWeaver, NVu, etc.)outbound from my Macs running 10.4 until, maybe this is obvious to everyone else, I enabled the FTO service in the Sharing system preferences:

System Preferences -> Sharing -> Services -> FTP Access (checked)

Until I made this change I could login but not get results from commands (such as 'dir'), presumably because the 8xxxx ports are blocked when FTP Access service is not allowed in Sharing.

Quite the frustration amongst me and my colleagues until we figured it out!



[ Reply to This | # ]
Also: System Preferences -> Sharing -> Services -> FTP Access (checked)
Authored by: adrianm on Apr 27, '06 09:26:10AM

I never had this problem, but probably because I set up passive FTP in the network preferences (I don't have a Mac near me at the time so can be sure where exactly).

Maybe some apps don't respect this setting and try to use active FTP ?



[ Reply to This | # ]
Also: System Preferences -> Sharing -> Services -> FTP Access (checked)
Authored by: rjamest on Apr 27, '06 04:47:45PM

Ya know... after sleeping I remembered that the problem was that the iptables rules on the server blocked the 8xxxx ports.

Sorry for the sleep-deprived confusion!

/me slinks away hopefully unnoticed



[ Reply to This | # ]
use .netrc
Authored by: nvdingo on Apr 27, '06 09:36:36AM

If you get tired of remembering to issue epsv4 for every connection, or adding the command line option to disable it, use the .netrc file to do it automatically.

putting the following into the .netrc (create if necessary) in your user directory, will automatically turn on/off epsv4 for all hosts you connect to

default
macdef init
    epsv4

That's it. One useful option that i added to my .netrc was this on the line after the epsv4 command, I added
   throttle put 30k

I have DSL with an outgoing bandwidth of 384kbps, which translates to roughly 34KBps. By adding the throttle command, i ensure that my outgoing file transfer doesn't take ALL of my outgoing bandwidth, which would choke my outgoing requests for webpages.

If you have ever wondered why your web surfing is so slow while sending a large file, it is because you are taking up all your outgoing bandwidth, and your request for the page can't even get out.

doesn't really matter if you have a 6Mbps business DSL line if your outgoing channel is saturated, you aren't going to surf anywhere fast

[ Reply to This | # ]