DOS FTP script does not work

DOS FTP access script

I am using this command:
ftp -s:ftp.txt
ftp.txt is this:
open 000.000.000.000
MyUser
MyPassword
lcd c:\_A
put TR.bak
quit

I get this response:
ftp> Connected to 000.000.000.000.
open 000.000.000.000
220 Microsoft FTP Service
User (000.000.000.000:(none)):
331 Password required for MyUser.

530 User MyUser cannot log in.
ftp> Local directory now C:\_A.
ftp> lcd c:\_A
put TR.bak
530 Please login with USER and PASS.
530 Please login with USER and PASS.
ftp> quit
221  

the password is correct. What am I doing wrong here?
LVL 2
hgj1357Asked:
Who is Participating?
 
Bill PrewConnect With a Mentor Commented:
Well, if you can't log in with that user doing it interactively at the command prompt not sure I can help with that much, it's an authentication problem of some sort.

Did you try verbose mode?

Did you check host FTP server logs?


»bp
0
 
Martin MillerCTOCommented:
Can you confirm manually your steps work ?
0
 
hgj1357Author Commented:
Ok. That's odd. Password is correct. 530 user MyUser cannot log in
0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
Bill PrewCommented:
Is MyUser set up as a valid FTP client user account on the FTP server you are connecting to?  (it doesn't seem to be...)


»bp
0
 
hgj1357Author Commented:
Yeah. It is.  I can access from a web browser with those credentials.  I'm trying to use a cmd script to automate uploads.
0
 
Bill PrewCommented:
You might try toggling verbose mode on with the verbose command and see what additional info it provides about the user id rejection.

Could the webserver be doing something different with the FTP request from a browser (port 80) compared to what the O/S FTP server is doing with incoming port 21 requests?  Is the browser session HTTP or HTTPS?

Check any FTP server logs on the host for any clues also.


»bp
0
 
hgj1357Author Commented:
80 vs 21   I bet that is it.
0
 
hgj1357Author Commented:
21 is open for FTP on both ends.
0
 
Bill PrewCommented:
But does the FTP server listening on port 21 on the host have that user and password defined?


»bp
0
 
hgj1357Author Commented:
Yes, it does.
0
 
hgj1357Author Commented:
Yeah.  FTP server is cerberus.  

Aaah.  Yes.  It would help if I turned on FTP on 21 on the cerberus, wouldn't it.
0
 
hgj1357Author Commented:
I had 21 open on the FTP server, but cerberus itself was listening for HTTPS not std ftp on 21
0
 
Bill PrewCommented:
Great, glad you got that sorted out, pesky computers :-).


»bp
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.