|
|
Why do my FTP transfers all freeze up?I've been trying to copy some files off an FTP archive, but every time I go to do the transfer, it says "Entering Extended Passive Mode" and never gets any further. My conclusion: this passive mode thing is a bust. How can I transfer the files without using passive mode? I'm using ftp from within a Terminal on my Mac, by the way. This is a somewhat common problem with FTP, actually, and while I admit that I'm not entirely sure what passive mode is either, I do know how to get around it within the ftp program. Here's an example of me grabbing a file from the O'Reilly Media server: $ ftp ftp.oreilly.com
Connected to ftp.oreilly.com. 220 ProFTPD 1.2.10 Server (ftp.oreilly.com) [172.31.173.9] Name (ftp.oreilly.com:taylor): ftp 331 Anonymous login ok, send your complete email address as your password. Password: 230-Welcome to the O'Reilly & Associates, Inc. FTP Archive. 230 Anonymous access granted, restrictions apply. Remote system type is UNIX. Using binary mode to transfer files. ftp> get /demo/demofile.zip demofile.zip local: demofile.zip remote: /demo/demofile.zip 229 Entering Extended Passive Mode (|||64758|) That's as far as it gets. Like you, my connection hangs. Fortunately, fixing it is as easy as typing in a single command into the ftp program: EPSV. Now watch what happens: ^C
receive aborted. Waiting for remote to finish abort. ftp> epsv EPSV/EPRT on IPv4 off. ftp> get /demo/demofile.zip demofile.zip local: demofile.zip remote: /demo/demofile.zip 227 Entering Passive Mode (209,58,173,9,252,250). 150 Opening BINARY mode data connection for /demo/demofile.zip (4908794 bytes) 100% |***************************************************| 4793 KB 163.08 KB/s 00:29 226 Transfer complete. 4908794 bytes received in 00:29 (162.48 KB/s) ftp> That's all there is to it. Hope that helps you get your FTP transfers going again too!
More Useful Unix and Linux Help Articles:
✔ Copy and Paste from the Mac OS X Command Line?
I am constantly running commands in Terminal.app on my MacBook and then copying and pasting the results into email messages or documents. Yes,...
✔ Shell script to convert lowercase to title case?As part of a project I'm working on, I find myself deep in a Linux shell script, needing to have a subroutine that...
✔ Can I script renaming files based on an XML data map?I have a folder full of files which are named with four digits and a file extension e.g. 0312.file and an XML-file describing...
✔ Test for valid numbers in a Bash shell script?In a different discussion on this site [see Redirecting input in a shell script] a visitor commented that "I was too busy trying...
✔ Review: iSSH for the iPad/iPhoneIf you're running an online business like I am, there are times when you need to connect and log in to the server...
Let's stay in touch!
Sign up for my weekly AskDaveTaylor Newsletter and you'll receive even more tech and gadget help
right to your inbox, along with exclusive news and industry updates. It's good stuff. I promise!
Categorized:
Mac OS X Help
,
Unix and Linux Help
(Article 6463,
Written by Dave Taylor)
Tagged: extended passive mode ftp, file transfer, ftp Previous: Does jewelry sold on eBay need an appraisal? Next: Why is Mailman complaining "Site list is missing: mailman"? Reader Comments To Date: 17TD said, on April 18, 2006 8:38 AM:
FTP Passive mode is used by most FTP programs with the prevalence of firewalls. The FTP protocol uses 2 ports (one for transfer one for control). When a file is requested the requestor sends a message to the server on the control connection. Then the server responds to the receiver by initiating a transfer connection to the requestor... but if there is a firewall, the transfer connection can't be made since the firewall will likely block it. So passive mode adds some protocol steps where the server opens up a port for the requestor to connect to for the transfer connection, sends that information to the requestor over the control channel, and the requestor makes the transfer connection. So in passive mode, all connections to the server are initiated from the requestor so they are allowed by the firewall. Tom Schneider said, on December 15, 2006 1:03 PM:
On my Mac OSX 10.4.8, this failed: ftp> EPSV HELP!! Also, is there a way to configure this automatically? Tom Schneider said, on December 15, 2006 1:08 PM:
Oh, it accepts lower case! ftp> epsv but it still hangs in 'Entering Passive Mode'. Eventually it said
421 Service not available, remote server timed out. Connection closed Interestingly it created an empty file on the Lylo said, on March 24, 2007 3:09 AM:
I'm experiencing this problem with two FTP servers. The EPSV off fix works fine one one (dataflame.co.uk) but failed on the other (p4host.com). I have tried turning the OSX firewall off completely but this makes no difference. I have tried the terminal, Cyberduck and Yummy FTP -- same problem with all of them. I'm running OSX 10.4.9 on an Intel Mac. Can anyone help?! James Howard said, on November 30, 2007 1:27 PM:
The general rule is that if you have a local NAT/firewall you'll want to use passive mode, and if you have a remote firewall, you'll probably need to use active mode. EPSV is a function of the remote server. If EPSV isn't working for your specific remote server, try PASV. Use the PASV and EPSV command to cycle passive mode off and on. Passive mode is on by default in most FTP clients. Lane said, on December 6, 2007 8:57 AM:
Thanks Dave, David said, on September 5, 2008 11:41 AM:
I am trying to get FTP to work between two SUSE servers and I have used the epsv command. When I try to transfer a file or do a dir command it hangs. Is there a solution? Chris E said, on March 10, 2009 7:30 AM:
Thanks for posting this, it helped me! Vipin said, on March 3, 2010 5:47 AM:
HI Dave, Recently i had a situation in which 1 user was able to do ftp to cleint but another was not.I checked /etc/ftpusers file,/etc/security/login.cfg file,ftpd daemon,/etc/security/passwd all was fine.But another user was not able to see the files under directory as 1st user can do.I can't figure out difference if any as i checked everything. Please help. Vipin said, on March 3, 2010 5:49 AM:
Its a AIX 5.3 Client Vipin Yadav said, on June 14, 2010 6:42 AM:
I have AIX5.3 server.I have lost root password,please tell me how to set the new root passsword asish said, on July 15, 2010 12:03 AM:
Hii Dave , Enzo said, on September 2, 2010 11:47 AM:
FTP is trickier than most people think. The client initially connects to the server on port 21. The server will communicate back to the client on its outbound port 20, but the port that it connects to on the client can be any port > 1023 depending on which mode the client is in. The client can be in ACTIVE or PASSIVE mode. If the client is in ACTIVE mode, it tells the server how to connect back to the client, including a port number > 1023. Each time you do a transfer or dir command, this will be a different port number. In PASSIVE mode, the server tells the client whic ip address & port number to connect to. The server can typically be configured to specify a range of ports for the passive mode. Here's a full overview. Senica said, on November 18, 2010 2:24 PM:
Thanks for the information. This works perfectly for me. I'm wondering if the passive command can work automatic like via a command procedure $ ftp/type=ascii server_name /user=user1 /pass =user1$ /pasv dir When I run this command via a procedure, it still hangs. But when I ftp manually, it works. Your help is appreciated! Thanks! Tsunami said, on March 23, 2012 4:57 AM:
I tried epsv, that didn't work for me. This did: ftp> passive Biz said, on March 28, 2013 6:39 PM:
Use to be, from Linux (SLES mainly) I would get the 229 Entering Extended Passive Mode (|||####|) error. Then long pause and then it worked. Then, about a year or two ago, it would just fail with something like: 421 Service not available, remote server timed out. Connection closed SO, I started to enter "PASS" before I did anything and that seemed to fix it. Now, it still fails and I have had to enter: "EPSV" And it is back working... Thank God. So, what is happening? I have been doing these FTP's from basically the same Linux system. I cannot speak for the remote system... They may have upgraded or something? What will be the next failure and what command will I use then?
I do have a comment, now that you mention it!Check This Out Too... |
Recent Entries
Look for Answers
Recommended
All Our Categories
Apple iPad Help
Articles and Reviews Auctions and Online Shopping Blogs and Blogging Building Web Site Traffic Business and Management Computer and Internet Basics d) None of the Above Facebook Help Google Gmail Help Google Plus Help HTML, JavaScript and Web Site Programming Industry News and Trade Shows iPhone and Cell Phone Help iPod, Sony PSP and MP3 Player Help Kindle Fire Help Mac OS X Help Pay Per Click (PPC) Advertising Pinterest Help Search Engine Optimization (SEO) Shell Script Programming Tech Support Video Help The Writing Business Twitter, LinkedIn and Social Network Help Unix and Linux Help Video Game Tips and Help Windows PC Help Find Me on Google+ ADT on G+ |
That may fix it, and may not.
FTP gets ugly on today's Internet, because it was designed in the 1970's, long before firewalls were common and before Network Address Translation (NAT) existed. The near universal use of firewalls and NAT on the Internet today make FTP problematic at times.
This document explains the issues and work arounds very well.
http://www.ncftp.com/ncftpd/doc/misc/ftp_and_firewalls.html