
autoworld
Novice
Aug 29, 2010, 1:24 AM
Post #1 of 5
(5418 views)
|
SCP a folder from local machine to remote machine...!
|
Can't Post
|
|
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)
|