Press "Enter" to skip to content

solve ftp client “501 Server cannot accept argument. ftp: bind: Address already in use”

在aws lightsail的一台实例上访问远程FTP出现了以下提示:

501 Server cannot accept argument.
ftp: bind: Address already in use

原因分析:
当前FTP client处在防火墙之后, 或者client上只有一个内网IP, 例如从阿里云EC2上面, 访问远程FTP服务, 即可能会出现这种提示.

解决办法:
使用passive模式去连接, 例如

pftp -v -n $FTP_IP << END    #使用pftp连接
user $FTP_USER $FTP_PASS
type binary
cd $FTP_backup
ls
delete $OldData
put $DataBakName
bye
END


或者

ftp -v -n -p $FTP_IP << END    #使用ftp -p
user $FTP_USER $FTP_PASS
type binary
cd $FTP_backup
ls
delete $OldData
put $DataBakName
bye
END

参考文档:
501 server cannot accept argument. Issue of FTP connection from Linux to Windows Server

Leave a Reply

Your email address will not be published. Required fields are marked *