Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > macOS > Strangeness using FTP in Terminal

Strangeness using FTP in Terminal
Thread Tools
xtian
Fresh-Faced Recruit
Join Date: Jul 2003
Location: San Francisco Bay Area
Status: Offline
Reply With Quote
Oct 21, 2004, 09:08 PM
 
Strange response from remote server:
[snip]
[adsl-63-197-000-000:~] xtian% ftp ftp.land.com
Connected to ftp.land.com.
220 FTP Server
Name (ftp.land.com:xtian): chris
331 Password required for chris.
Password:
230 User chris logged in.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls -a
229 Entering Extended Passive Mode (|||41183|)
200 EPRT command successful
[/snip]

See the line "ftp> ls -a"? This is supposed to list the directory contents [http://www.seotoolbox.com/html-issues/easy-ftp.html], instead sends a cpommand to enter passive mode. Whats going on???
     
Xeo
Moderator Emeritus
Join Date: Mar 2001
Location: Austin, MN, USA
Status: Offline
Reply With Quote
Oct 21, 2004, 11:11 PM
 
Originally posted by xtian:
Strange response from remote server:
[snip]
[adsl-63-197-000-000:~] xtian% ftp ftp.land.com
Connected to ftp.land.com.
220 FTP Server
Name (ftp.land.com:xtian): chris
331 Password required for chris.
Password:
230 User chris logged in.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls -a
229 Entering Extended Passive Mode (|||41183|)
200 EPRT command successful
[/snip]

See the line "ftp> ls -a"? This is supposed to list the directory contents [http://www.seotoolbox.com/html-issues/easy-ftp.html], instead sends a cpommand to enter passive mode. Whats going on???
It's entering passive mode to send you the data (being the ASCII text making up the contents of the directory). This is normal for clients that default to passive such as Mac OS X's FTP command.

Oh, and "ls" in FTP already lists "dot" files, so adding the "-a" flag only shows you "." and ".." which aren't useful anyway. So you might as well save the keystrokes. (This is potentially server specific information though, so it may not apply to non-Mac OS X ftpd's.)
     
xtian  (op)
Fresh-Faced Recruit
Join Date: Jul 2003
Location: San Francisco Bay Area
Status: Offline
Reply With Quote
Oct 22, 2004, 08:15 PM
 
Originally posted by Xeo:
It's entering passive mode to send you the data (being the ASCII text making up the contents of the directory). This is normal for clients that default to passive such as Mac OS X's FTP command.
Oh. That's one of the things about ftp that I meant to understand, but never did anything about it.

Your reply suggested I should wait longer for the server to reply. I did and this is what it said:
ftp> ls /
229 Entering Extended Passive Mode (|||33903|)
200 EPRT command successful
421 Service not available, remote server timed out. Connection closed
ftp>
I'm no closer to using OS X UNIX to ftp to my web server.
     
Xeo
Moderator Emeritus
Join Date: Mar 2001
Location: Austin, MN, USA
Status: Offline
Reply With Quote
Oct 22, 2004, 09:30 PM
 
Originally posted by xtian:
Oh. That's one of the things about ftp that I meant to understand, but never did anything about it.

Your reply suggested I should wait longer for the server to reply. I did and this is what it said:


I'm no closer to using OS X UNIX to ftp to my web server.
You can try turning off passive mode and see if that helps. Once FTP'd to the server, type "passive" and it should say that passive is off. Then try the command again.
     
xtian  (op)
Fresh-Faced Recruit
Join Date: Jul 2003
Location: San Francisco Bay Area
Status: Offline
Reply With Quote
Oct 23, 2004, 05:13 PM
 
that did it xeo, thanks for your help. xtian
     
hotani
Senior User
Join Date: Sep 2000
Location: Denver, CO, USA
Status: Offline
Reply With Quote
Jul 19, 2005, 03:01 PM
 
Ok, I just found this thread and am having exactly the same problem. However, turning off passive mode only resulted in this:
Code:
Passive mode: off; fallback to active mode: off. ftp> dir 500 Illegal EPRT command 200 PORT command successful
and then it sits there doing nothing. Connecting via clients like Transmit work fine, but i need CLI too for when I'm not sitting in front of the machine.
// hōtani
MDD G4 dual 867
     
hotani
Senior User
Join Date: Sep 2000
Location: Denver, CO, USA
Status: Offline
Reply With Quote
Nov 17, 2005, 02:59 PM
 
I let this go for a while but today I wanted to ftp something and realized I never found a solution. Does anyone know how to resolve this?
// hōtani
MDD G4 dual 867
     
wadesworld
Grizzled Veteran
Join Date: Apr 2001
Status: Offline
Reply With Quote
Nov 17, 2005, 05:48 PM
 
Turning off passive mode when a firewall is involved, will cause the connection to hang.

If CLI does not work in passive mode, chances are that there's a server or firewall problem.
     
xtian  (op)
Fresh-Faced Recruit
Join Date: Jul 2003
Location: San Francisco Bay Area
Status: Offline
Reply With Quote
Nov 18, 2005, 12:57 AM
 
Try a combination of:

epsv4
passive

(such as epsv4 only, or with passive, or passive only).
I don't know yet why these commands work, but they help me.

good luck
xtian
     
hotani
Senior User
Join Date: Sep 2000
Location: Denver, CO, USA
Status: Offline
Reply With Quote
Nov 18, 2005, 05:20 PM
 
THANK YOU! 'epsv4' seems to do the trick.
// hōtani
MDD G4 dual 867
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 04:19 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,