in reply to Net::SFTP Problem

You should try Net::SFTP::Foreign. It's a fork of Net::SFTP that uses the native ssh binary to stablish the connection with the remote host instead of Net::SSH::Perl.

Replies are listed 'Best First'.
Re^2: Net::SFTP Problem
by Zoop (Acolyte) on Jun 07, 2005 at 11:02 UTC
    Hi Salva,

    I tried Net::SFTP::Foreign Modeule in my program. in this case I am using this code...
    ############################## #! usr/bin/perl use Net::SFTP::Foreign; $host="myserver"; $username="vendor1"; $portnumber=22; %args={port => $portnumber ,host =>$host ,user => $username ,debug => +1}; my $sftp = Net::SFTP::Foreign->new($host,%args); @str=$sftp->ls("/home/vendor1/"); foreach $hashref(@str) { foreach $key(keys%$hashref) { print "\t $$hashref{$key}\t"; } print "\n"; } #########################
    Now as both vendor1 and vendor2 are users on the same server which i dont think makes any difference,but now I am getting password prompt for vendor2...

    + perl sftp.pl vendor2@9.182.244.13's password:
    ...which i think i should not get. The output should be the output of "ls" command..
    can you suggest some solution...
    Thanx
    Zoop

    'When You starve With A Tiger, The Tiger always starves last'
      oh, I thought you were using ssh keys for authentication instead of the login and clear password aproach not supported by that Net::SFTP::Foreign.

      Is there any reason why you are not using public keys for authentication?

        Hi Salva,
        I have to use ssh keys authentication but i am not aware of the method to use it in my code. Can you Please suggest what steps do i require to modify my previous code to use ssh keys authentication. I have OpenSSH_3.8.1p1 and OpenSSL 0.9.7d installed on AIX box.
        Thanx in advance
        Zoop
        'When You starve With A Tiger, The Tiger always starves last'