CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Advanced: SCP a folder from local machine to remote machine...!: Edit Log



autoworld
Novice

Aug 29, 2010, 1:24 AM


Views: 2325
SCP a folder from local machine to remote machine...!

Hi all,

I am trying fo automate few test cases. I need to send a folder to a remote system using SCP. I have done ssh to the remote machine and passed scp as shell command. I am finding it tough to give password for the scp.. Please help...



#!/usr/bin/perl

use Net::SSH::Perl;

my $host = "192.168.200.254";
my $user = "root";
my $password = "root";




#-- set up a new connection
my $ssh = Net::SSH::Perl->new($host);
#-- authenticate
sleep(3);
$ssh->login($user, $password);
sleep(2);

#need to enter password after scp. please help...!
$ssh->cmd("scp -r user@192.168.200.165:/home/user/1020_exe 1020_exe");

sleep (5);

$ssh->cmd("cd 1020_exe");
sleep(1);

$ssh->cmd("chmod 777 *");
sleep(1);


$ssh->cmd("./hello");
sleep(1);


(This post was edited by autoworld on Aug 29, 2010, 1:31 AM)


Edit Log:
Post edited by autoworld (Novice) on Aug 29, 2010, 1:31 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives