in reply to Re^5: SFTP Issue
in thread SFTP Issue

Khen
if we use password to authenticate , will it use the public keys then..(just wanted to know) iused the following piece of code , it seems to connect and sending the "ls" command, but i am not getting any reply back

use strict; use warnings; use Net::SSH::Perl; my $host = "217.154.215.76"; my $user = "etrade"; my $cmd = "ls rolling*"; my $ssh = Net::SSH::Perl->new($host, debug => 1, identity_files => ["/ +etrade/home/ibia_ir/.ssh/id_rsa"], protocol=>'2,1'); $ssh->login($user); my($stdout, $stderr, $exit) = $ssh->cmd($cmd); print "$stdout"; print "$stderr"; print "$exit";

Replies are listed 'Best First'.
Re^7: SFTP Issue
by prasanna14 (Initiate) on Jul 17, 2008 at 19:35 UTC
    Khen , i am able to login and list files using the following code now, but not able to get the files

    use strict; use warnings; use Net::SFTP; my $host = "hostname"; my $user = "username"; my $remote = './trade_080417_121605.csv'; my $ssh= Net::SFTP->new($host , user=>$user,ssh_args => [ identity_fil +es => [ "/etrade/home/ibia_ir/.ssh/id_rsa"],debug => '1']); $ssh->ls("." , sub { print $_[0]->{longname}, "\n" });
    any thoughts how to proceed further??

    Thanks in advance