ChipmunkCHeeks has asked for the wisdom of the Perl Monks concerning the following question:

I have updated to the latest version of Net::SFTP 0.09, also updating Net::SSH::Perl to 1.28. This includes any prerequisites needed for succesful builds & test. I configured Net::SSH::Perl with both SSH1 & SSH2 and using Blowfish for encrytion.

When I issue the following commands:
%args = (user => $serverId, password => $serverPass); $sftp = Net::SFTP->new($serverName, %args);
with $serverId & $serverPass defined, I get:
Permission denied at /usr/local/lib/perl5/site_perl/5.8.7/Net/SFTP.pm +line 62
I can login successfully to sftp via command line.
Any clues would be helpful. Thanks in advance.

Replies are listed 'Best First'.
Re: SFTP on Solaris 2.7
by waswas-fng (Curate) on Jun 30, 2005 at 22:48 UTC
    Check your user and pass, line 62 is where is tries to auth against the server -- and you are getting a permission denied.


    -Waswas
Re: SFTP on Solaris 2.7
by BaldPenguin (Friar) on Jun 30, 2005 at 23:00 UTC
    I know that the SSH protocol defaults to 3des for encryption, if you are using blowfish by default, you may have to set that in the ssh_config. Net::SFTP passes that list into the Net::SSH::Perl sub that makes the connection;
    # UNTESTED my %args = ( 'user' => $serverId, 'password' => $serverPass, 'ssh_args' => { 'cipher' => 'blowfish, }, ); my $stfp = Net::SFTP->new( $serverName, %args );
    Update: ssh_config s/b ssh_args

    You could also set the debug values for better messages;
    my %args = ( 'user' => $serverId, 'password' => $serverPass, 'debug' => 1, ); my $stfp = Net::SFTP->new( $serverName, %args );

    Don
    WHITEPAGES.COM | INC
    _

    Edit by castaway: Closed small tag in signature

Re: SFTP on Solaris 2.7
by salva (Canon) on Jul 01, 2005 at 09:15 UTC
    if you can use public/private pairs of keys instead of user/login for authentication, try Net::SFTP::Foreign. It uses the native ssh binary to stablish the connection to the server instead of Net::SSH::Perl and so it is more robust and doesn't require a bunch of additional modules to work.