Posted on 2007-07-03 23:43:06-07 by jmarshll in response to 5606
Re: 64-bit code won't compile and can't connect to sftp server
Hi again. After stripping out some other code that my prog uses that did something to alter the err +or msg, I still get an error, but the msg is a little different from what I originally told you. F +or the server I'm testing, I can connect using the keys just fine from the command line, like... sftp -o IdentityFile=/home/myuser/.ssh/my_priv_key_file myuserid@sftp.myhost.com This is the script that's failing, along with the other info you asked for... use Net::SFTP::Foreign; my $host = 'sftp.myhost.com'; my $user = 'myuserid'; my $port = '22'; # the server is actually listening on port 22 my $sftp = Net::SFTP::Foreign->new( host => $host, user => $user, port => $port, more => [qw(-v -i /home/myuser/.ssh/my_priv_key_file)] ); $sftp->error and die "SSH connection failed: " . $sftp->error; The cmd to execute is... perl -T SFTPTest.pl The error msg I get is... SSH connection failed: Connection to remote server is broken at SFTPTest.pl line 15 Sorry I can't be more helpful. Thanks for your assistance...
Direct Responses: Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.