向一个环境内通过FTP推一个包,其中遇到不能在目标文件夹建立文件和文件夹的麻烦,关闭Passive mode就好了,记录一下。
[root@yw ~]# ftp x.x.x.x
Connected to x.x.x.x.
220 Serv-U FTP Server v6.2 for WinSock ready...
500 'AUTH': command not understood.
500 'AUTH': command not understood.
KERBEROS_V4 rejected as an authentication type
Name (172.16.1.96:root): xxd
331 User name okay, need password.
Password:
230 User logged in, proceed.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> hash
Hash mark printing on (1024 bytes/hash mark).
ftp> put /tmp/gateway20230828090000.csv
local: /tmp/gateway20230828090000.csv remote: /tmp/gateway20230828090000.csv
227 Entering Passive Mode (10,76,133,126,90,92). --主要就是这个模式不让建立文件
550 Permission denied.
ftp> passive
Passive mode off .--关闭Passive mode
ftp> put /tmp/gateway20230828090000.csv
local: /tmp/gateway20230828090000.csv remote: /tmp/gateway20230828090000.csv
200 PORT Command successful.
550 : Cannot create file . --要进入/tmp才能上传东西
--进入/tmp
ftp> lcd /tmp
Local directory now /tmp
ftp> put CentOS-5.2-i386-bin-DVD.iso
local: CentOS-5.2-i386-bin-DVD.iso remote: tmp/gateway20230828090000.csv
200 PORT Command successful.
150 Opening BINARY mode data connection for tmp/gateway20230828090000.csv
226 Transfer complete.
ftp> quit
421 Connection timed out - closing.