我试图创建一个简单的ftp批处理文件,定期上传少量文件,但我似乎无法正确登录。我可以使用相同的凭据并通过Filezilla登录,没有问题,但是从命令行它不起作用。
以下是我所尝试的:
ECHO Creating Script File for FTP Download for District %2....
ECHO open xxx.xxx.xxx.xxx >ftp.scr
ECHO myuser >>ftp.scr
ECHO mypassword >>ftp.scr
ECHO bin >>ftp.scr
ECHO send %1 >>ftp.scr
ECHO quit >>ftp.scr
ftp -s:ftp.scr很简单,我相信这一点。
以下是它所作的回应:
D:\Suburban>ftp -s:ftp.scr
ftp> open xxx.xxx.xxx.xxx
Connected to xxx.xxx.xxx.xxx
220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
220-You are user number 5 of 50 allowed.
220-Local time is now 10:16. Server port: 21.
220 You will be disconnected after 15 minutes of inactivity.
User (xxx.xxx.xxx.xxx:(none)):
331 User myuser OK. Password required
530 Login authentication failed
Login failed.
ftp> bin
200 TYPE is now 8-bit binary
ftp> send webtrn25.001
530 You aren't logged in
530 You aren't logged in
ftp> quit
221-Goodbye. You uploaded 0 and downloaded 0 kbytes.
221 Logout.我认为这应该是直截了当的,但似乎没有什么是.这一定是很简单的事情,我忽略了。
任何输入都将不胜感激!
编辑**
此外,如果我从命令行直接运行这些命令,我就可以通过ftp登录:
D:\Suburban>ftp
ftp> open xxx.xxx.xxx.xxx
Connected to xxx.xxx.xxx.xxx
220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
220-You are user number 5 of 50 allowed.
220-Local time is now 10:19. Server port: 21.
220 You will be disconnected after 15 minutes of inactivity.
User (xxx.xxx.xxx.xxx:(none)): myuser
331 User myuser OK. Password required
Password:
230 OK. Current restricted directory is /
ftp>发布于 2014-04-01 15:26:41
我辩论删除这个,mods可能仍然这样做,但我想出了我的问题。可能会对以后的人有帮助.
ECHO myuser >>ftp.scr
ECHO mypassword >>ftp.scr名称/密码与>>之间的空格是问题所在。
一旦我把它改成:
ECHO myuser>>ftp.scr
ECHO mypassword>>ftp.scr效果很好!
https://serverfault.com/questions/585931
复制相似问题