0

My question is when using lftp to download file from a sftp site with automating password :

lftp -e 'set xfer:clobber on; mget -c one_file' -u username,passwd  sftp://hostname

lftp still prompt "Enter your PASSWORD:" to ask me the password. My operating system is Windows xp. Can anybody tell me what is problem ?

Background: I want to transfer large files automatically from a sftp site when some condition is met. I find lftp is a good tool to transfer large files because it can resume the transfer in background when the link is disconnected due to the instable net connect status. I use python on Windows to control lftp to download the large files. But it seems to automating password in lftp is failed. I also try the expect-like method, such as winpexpect, but it seems can't solve this problem. However, I find others use lftp -u to automate password for sftp site when doing google searching, why it failed here ?

Thank you in advance!

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129

1 Answers1

0

(Answered in a question edit. Converted to a community wiki answer. See What is the appropriate action when the answer to a question is added to the question itself? )

The OP wrote:

I have solved it.

I find the ssh used by lftp is not the one in the directory of lftp, but another one (ssh under the directory of mingw) because the route of mingw in PATH is prior to lftp. I move the route of lftp in front of mingw in PATH variable, then the problem is solved.

Community
  • 1
  • 1
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129