登录时,cmd ftp密码错误(cmd ftp password error when logging in)

其他开发 IT屋
百度翻译此文   有道翻译此文
问 题

I'm trying to automate an ftp upload with a Batch script using the ftp -s:commandsfile.ftp command, at first everything seems OK: ftp server sends welcome message, username is automatically introduced, but when ftp asks for a password, nothing is introduced and all other commands that commandsfile.ftp sends return a "530 You aren't logged in" error:

Connected to ns12.dnchosting.com.
220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
220-You are user number 5 of 50 allowed.
220-Local time is now 16:02. Server port: 21.
220-This is a private system - No anonymous login
220-IPv6 connections are also welcome on this server.
220 You will be disconnected after 15 minutes of inactivity.
User (ns12.dnchosting.com:(none)):
331 User [USERNAME]  OK. Password required

530 Login authentication failed
Login failed.

This is the commandsfile.ftp file:

open web12.dnchosting.com 
[USERNAME]
[PASSWORD] 
lcd 
cd afolder 
mkdir anotherfolder 
mput "*.*" 
disconnect 
bye 

And this the batch script:

ftp -i -s:commandsfile.ftp

Why is CMD not introducing the password?

解决方案

Alright, problem solved... the ftp file had an extra space character at the end of each line, so that the password entered was the password plus an extra space because the ftp file is dynamically generated.

本文地址:IT屋 » cmd ftp password error when logging in

问 题

我试图通过使用 ftp -s:commandsfile.ftp 命令的批处理脚本自动执行ftp上传,起初一切似乎都正常:ftp服务器发送welcome消息时,会自动引入用户名,但是当ftp要求输入密码时,不会引入任何内容,而commandfile.ftp发送的所有其他命令都返回“530您未登录”错误:

 连接到ns12.dnchosting.com。 
220 ----------欢迎使用Pure-FTPd [privsep] [TLS] ----------
220 - 您是第50个用户。
220 - 当地时间现在是16:02。服务器端口:21.
220 - 这是一个专用系统 - 不需要匿名登录
220-IPv6连接也可以在此服务器上使用。
220您在闲置15分钟后会断开连接。
用户(ns12.dnchosting.com:(none)):
331用户[USERNAME]确定。需要密码

530登录认证失败
登录失败。


这是commandsfile.ftp文件:



 打开web12.dnchosting.com 
[USERNAME]
[PASSWORD]
lcd
cd afolder
mkdir anotherfolder
mput“*。*”
disconnect
bye


批处理脚本:

  ftp -i -s:commandsfile.ftp 


为什么CMD没有引入密码?

解决方案

好的,问题解决了...... ftp文件在每行的末尾都有一个额外的空格字符,所以输入的密码是密码加上一个额外的空间,因为ftp文件是动态生成的。


本文地址:IT屋 » 登录时,cmd ftp密码错误

官方微信
扫一扫关注IT屋
微信公众号搜索 “ IT屋 ” ,选择关注
与百万开发者在一起