LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 937|回复: 5

如何实现这种带有防火墙的FTP服务器自动登录

[复制链接]
发表于 2003-9-27 08:20:00 | 显示全部楼层 |阅读模式
ftp 192.168.1.100
Connected to 192.168.1.100.
220-Welcome to the FTP proxy.
220-
220-To connect to a remote FTP server enter your name as:
220-user@server.serverdomain (e.g. anonymous@host.cs.mumble.edu)
220-
220-This proxy supports user authentication.
220-
220-The FTP proxy supports user authentication. You must authenticate
220-yourself before you can connect to the target system.
220-
220-Use the command below to authenticate yourself. The proxy
220-displays a challenge. Provide the correct response to the
220-challenge issued by the proxy.
220-
220-Depending on the authentication method that you use, you must
220-generate the response to the challenge in different ways. For
220-example, if you are using a handheld authentication card, use
220-the card to calculate the response. If you are using a once-off
220-password, simply type in the password.
220-
Name (192.168.1.100:huicai):
530 login via pass-through as user@host
Login failed.
ftp>   open 192.168.1.100
Already connected to 192.168.1.100, use close first.
ftp> quote authenticate MyID
331 Enter your password.
ftp>quote response MyPasswd
220-User 'MyID' authenticated.
530 Please login with USER and PASS.
220  
ftp> user MyID@node1
331 Password required for MyID.
Password:
MyPasswd
蓝色是需要输入的,请问怎么让它自动登录?
谢谢!

仿照下面做,没成功
# 建立一个文本文件,例如文件名是ftp.txt,其内容如下:
open 192.168.1.100 /*用open连接远程服务器192.168.1.100*/
user MYNAME MYPASSWORD /*MYNAME是用户名,MYPASSWORD是密码*/
binary /*以二进制传送*/
hash /*当有数据传送时,显示#号*/
cd REMOTE_PATHNAME /*进入远程目标路径REMOTE_PATHNAME*/
get REMOTE_FILE LOCAL_FILE /*把远程文件REMOTE_FILE下载成本地文件LOCAL_FILE*/
put LOCAL_FILE REMOTE_FILE /*将本地文件LOCAL_FILE上传成远程文件REMOTE_FILE */
bye /*退出ftp应用*/
# 执行命令:
cat ftp.txt | ftp -n
发表于 2003-9-27 11:04:29 | 显示全部楼层
没用-i这个选项试试?
 楼主| 发表于 2003-9-27 12:32:25 | 显示全部楼层
多谢
刚才测试了一下,也没成
发表于 2003-9-27 12:47:19 | 显示全部楼层
把IP后面加个端口号(21)再试试吧~~,:sorry
 楼主| 发表于 2003-9-27 14:07:56 | 显示全部楼层
多谢,是这个意思么?
cat f.txt | ftp -in

我的f.txt:
open  192.168.1.100 21
quote authenticate MyID
quote response password
user MyID@node1
MyPasswd
发表于 2003-9-27 14:30:50 | 显示全部楼层
感到这些自动化的例子少。
到现在我没没懂呢!
例如
写一个脚本 增加一个用户
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表