tags:

views:

23

answers:

1

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 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;
A: 

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

Karl Bielefeldt
Yes, you are right, I left it at port 21 which is in most of the examples found with the pm information. I actually tried 21 and 22 (which is what the host informed me to use).
Tom