Ask a Question related to PERL Modules, Design and Development.

  1. #1

    Default Net::SFTP problems


    I'm trying to get Net::SFTP working and I've spent several hours with
    the CPAN shell and ran into a few walls including couple of Math
    modules (Math::Pari and Math::PariBuild) and some other Crypt::
    dependancies. I finally got everything installed and when I run my
    script which contains:

    my $sftp = Net::SFTP->new($host, user=>"$username", pass=>"$password");

    I get the following error:

    Permission denied at
    /usr/lib/perl5/site_perl/5.8.0/Net/SFTP.pm line 37

    and line 37 in SFTP.pm is:

    $ssh->login($param{user}, $param{password});

    I can SSH and SFTP into the $host from a command prompt. I'm running
    Redhat 9 and I have all the correct modules installed. I've looked
    around and have seen that others have been having the same problems but
    nobody seems to offer a fix. And and all help would be appreciated.

    Thanks

    --
    Posted via [url]http://dbforums.com[/url]
    gnet Guest

  2. Similar Questions and Discussions

    1. connection problems - ftp & sftp-pls help!
      when we try to connect now (via ftp or sftp) we get the error: "Contribute has disabled your connection to this website because an unknown error...
    2. SFTP Connection Problems
      I'm attempting to set up a new connection using SFTP. Every time I try to connect, I receive a "Please make sure that you have sufficient...
    3. Aargh. SFTP problems
      I have a Windows machine attempting to start an sftp session with a Linux OpenSSH host. I have Net::SSH::SFTP, Net::SSH::W32Perl and required...
    4. Help with Net::SFTP when sftp on unix works.
      Running on AIX, the unix sftp will connect to my site just fine, but the Net::SFTP perl modules hangs at one point. Here are the logs for the...
    5. cwd with Net::SFTP
      There is an option to use 'cwd' with the Net::FTP. How can I perform this action with the SFTP (I didn't find it in the info pages of Net::SFTP)? ...
  3. #2

    Default Re: Net::SFTP problems


    Anyone know how to get $sftp->ls to work. I want to be able to have a
    variable/array that contains all the file names and i don't know how to
    extract the filename from the "HASH" that CPAN talks about.

    --
    Posted via [url]http://dbforums.com[/url]
    gnet Guest

  4. #3

    Default Re: Net::SFTP problems


    Originally posted by gnet
    > Anyone know how to get $sftp->ls to work. I want to be able to have a
    > variable/array that contains all the file names and i don't know how
    > to extract the filename from the "HASH" that CPAN talks about.
    >
    The $sftp->ls returns the arrays of hashes.

    try this code to print all the filenames

    @$files=$sftp->ls($remote_dir);

    foreach (@$files){

    $file=$_;

    $filename=$file->{filename};

    if($filename ne "." && $filename ne ".."){

    print"the filename is $filename";

    }

    }

    try this code to print all the values return by $sftp->ls

    @$files=$sftp->ls($remote_dir);

    foreach (@$files){

    $file=$_;

    foreach (sort keys %$_){

    print "the value is $_ => $file->{$_}";

    }

    }

    if any dout mail to me at [email]impish_imran@yahoo.co.in[/email]


    --
    Posted via [url]http://dbforums.com[/url]
    imran Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139