PDA

View Full Version : XP's FTP syntax is driving me mad!!


Norm
03-25-04, 11:16 PM
I'm trying to login to my ISP's freespace using FTP commandline.
No problem at all using an FTP Client (FTP Explorer) with same username and password.
Note: username and password in my example have been changed to protect the innocent :)


I am using a cmd file pointing to a txt file.

ftp.cmd
ftp -s:ftp.txt ftp.cogeco.ca

ftp.txt
user norm@cogeco.ca 549rthg3te

I get an error from the ftp protocol
"error reading password"

Then an error from the server
530"login incorrect"
login failed

XP's ftp help files give the above syntax for "user" command.
Is this a known problem with the XP FTP command USER, or did I miss something in the command syntax?

Thanks for saving me a few hairs
Norm

TonyT
03-26-04, 06:49 AM
windows 2000 ftp commands (http://www.microsoft.com/windows2000/en/server/help/default.asp?url=/windows2000/en/server/help/ntcmds.htm)

in XP:
http://www.faqts.com/knowledge_base/view.phtml/aid/24489/fid/868

I also remember reading s/g about how MS is changing how commmandline ftp functions, possibly in the future, or in one of the recent security updates. I remember this and forwarded what I read to the Cool Page developer cause CP uses command loine ftp to publish to web. Damned if I can remember where I saw it though.

Norm
03-26-04, 07:16 AM
There's nothing about any hyphen in the command syntax Tony.
Tried it, and getting the same error.
Thanks for checking into it for me.

Here's exactly what I get either way.

Connected to ftp.cogeco.ca.
220 fep2.cogeco.net NcFTPd Server (licensed copy) ready.
User (ftp.cogeco.ca:(none)):
331 User okay, need password.
Error reading password.

530 Login incorrect.
Login failed.
ftp>

I'm using the same username and password as I use for my FTP client (FTP Explorer) and it works ok.
Anyone know what the problem could be?

Norm
03-26-04, 07:24 AM
nm - I missed the second link there Tony
Thanks, I got it working.

ftp.cmdftp -s:ftp.txt
ftp.txt
open ftp.cogeco.ca
norm@cogeco.ca
549rthg3te

Now I can get on with the rest of my experiments.

Thanks again, Tony. I searched all over for help with this and never came across that example.
I still wonder why it doesn't work as the "manual' suggests though.

TonyT
03-26-04, 07:57 AM
The command: ftp.host.com just establishes a connection to the hiost.

The open command is needed to open a specified account, authenticated or anonymous, on an ftp server.

Faust
03-26-04, 06:16 PM
here's a short page that goes into some of the guts of FTP, Norm. this really really helped when i was having problems FTPing through a router.

http://www.allaboutjake.com/network/linksys/ftp.html

something folks overlook is that there are 2 connections per FTP session, and depending on the configuration (PORT or PASV), BOTH of the systems on either end are acting as a server. depending on the compatability of the router and/or FTP client, either the data or control channel may not be relayed or forwarded properly, resulting in access or login problems.

TonyT
03-26-04, 06:46 PM
Faust - FYI

That must be quite an old ftp guide as it mentions the Linksys problems. I've had a Linksys router for almost 5 yrs and never had any issues using ftp clients or ftp servers through the router.

cyberskye
03-26-04, 07:28 PM
Any ftp server sitting behind a non-spi router will have problems with active mode ftp. The router doesn't know which port was selected for data and so drops the inbound connect.

Most clients (esp browsers) use pasv so it doesn't come up very often.

Either way, ftp is very insecure on many levels. There is no way to secure it really without replacement (sftp or the like).

Faust
03-26-04, 08:46 PM
Originally posted by TonyT
Faust - FYI

That must be quite an old ftp guide as it mentions the Linksys problems. I've had a Linksys router for almost 5 yrs and never had any issues using ftp clients or ftp servers through the router.



lol, well now that you mention it, i have had it in my favorites/bookmarks through many fresh installs.

i haven;t had problems with using the default ports 20/21 on the few routers i have monkeyed with within the FTP context, but using non-standard ports (higher up in the less scanned/unregistered port range) would usually make things difficult.

depends on the exact scenario, i suppose.

Norm
03-26-04, 09:06 PM
My router is an old Netgear rt311, but never a problem with ftp.
I've never had to use pasv mode with any client yet either.

It is either a bad command in XP's ftp commandline, or I misunderstood the nature of the command.

Now that I'm using the other method with 'open' followed by username, then password on separated lines to login, everything is fine.

I had never done any ftp commandline stuff so I was a newb again :D

Thanks for the advice guys, always appreciated. :thumb:

TonyT
03-27-04, 06:37 AM
Most clients (esp browsers) use pasv so it doesn't come up very often.
On the contrary, most ftp clients, command line ftp and Internet Explorer will use PORT mode ftp by default, unless Passive Mode is set by the user.

Port mode is the www standard default unless specified with a command line switch. The ongrowth of dsl has seen more and more passive mode ftp use because passive mode ftp is required if a user has dsl connection.

Either way, ftp is very insecure on many levels.
Agreed. The biggest risk is that standard ftp uses clear text passwords which can easily be sniffed.