Joseph N
Joseph N

Reputation: 11

Failing to FTP with python (badly)

I'm trying to FTP a file to Juniper and I'm failing. I think it has something to do with the pasv setting but I don't know what it should be as I've tried both pasv=true and pasv=false. Help please?

ftp.set_pasv(False)
ftp.storbinary('STOR myfile', fileRSI)

error_perm: 500 Illegal PORT command.

ftp.set_pasv(True)
ftp.storbinary('STOR myfile', fileRSI)

error_temp: 425 Security: Bad IP connecting.

Upvotes: 1

Views: 1270

Answers (1)

Steffen Ullrich
Steffen Ullrich

Reputation: 123270

error_temp: 425 Security: Bad IP connecting.

This is a security check by vsftp that the control connection and the data connection originate at the same IP address. I assume that either

  • you have a multi-homed machine (i.e. multiple IP addresses on the same interface) and python ftplib is messing something up (unlikely)
  • you are trying to do FXP where the data connection and control connection are handled by different hosts (unlikely)
  • there is some strange network translation going on inside your router or firewall

Upvotes: 2

Related Questions