I was create a Perl script that can be transfer file from one machine to another 
machine using Net::SFTP module...
Here is the script

============================
#!/usr/bin/perl


use Net::SFTP;
#use strict;
#use warnings;



$host = $ARGV[0];

$anonyuser = $ARGV[1];



if($ARGV[1] eq "-a") {



                 $username = "anonymous";

                 $password = "-anonymous@";



} else {        

        


        print("\nHost\/IP: ");

        $host = <STDIN>;

        chomp ($host);



        print("\nUsername: ");

        $username = <STDIN>;

        chomp ($username);



        print("\nPassword: ");

        $password = <STDIN>;

        chomp ($password);

    }





print("Connecting to $host...\n");

$ssh = Net::SFTP -> new($host) or die "Couldn't connect to $host\n";
 

print("Connected!\n");

print("\nSFC>");



$ssh->login($username, $password)

or die "Could not log in .\n";

    

rep:

            

$command = <STDIN>;

chomp ($command);

unless ("$command" eq "bye") 
{                                        

                  @listing = $ssh->$command;

                  for($i=0;$i<@listing;$i++) { print "$listing[$i]\n"; 
}      

                  print("SFC>");                     

                  #goto rep;                              
}


===================================
But, when i running this script i got this message

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

i don't know whats going on...can somebody help me.?..


 

This e-mail and any attachments may contain confidential and
privileged information. If you are not the intended recipient,
please notify the sender immediately by return e-mail, delete this
e-mail and destroy any copies. Any dissemination or use of this
information by a person other than the intended recipient is
unauthorized and may be illegal.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to