开发者

Perl Net::FTPSSL, won't connect, timeout or throw errors

I am trying to use perl's Net::FTPSSL to connect to a host. When I run the script, it hangs and eventually times out on my error logs, but not to the browser. The problem seems to be when开发者_JAVA技巧 creating the new connection. If I use Filezilla to connect, there is a pause/response warning that the host key is unknown. When I 'ok' it in Filezilla, it passes a command "Trust new Hostkey: Once" and send the password and logs in. If this is my problem, how do I send that 'ok'? Here is my code - it hangs on the second line - before even getting to the username/password.

The code I'm using is:

use Net::FTPSSL;
$ftpobj = Net::FTPSSL -> new('host.com', Port => 21) or die "Can't open server.";
$ftpobj -> login("user","pass");
$ftpobj -> get ("file.csv");
$ftpobj -> quit;


This might be intentional, but sftp is usually hosted on port 22, and you have port 21.


SFTP and FTPS are two completely different protocols:

  • FTPS is FTP on top of SSL or TLS
  • SFTP is a protocol for file transfer that runs on top of SSH
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜