Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 514
  • Last Modified:

ssh thru perl

My requirement.
i m running my script from server xyz.com under the directory /u/rshah1/temp.pl
in my perl script temp.pl i want to do ssh abc.com and there is a file run.pl in the directory /v/temp
is it possible to do in temp.pl

when i do ssh in perl script and run my scipt it does the ssh and my console get transferred to abc.com i cannot execute anything after ssh

so i want to run a script that resides on different server.

Thanks.
0
shahrahulb
Asked:
shahrahulb
1 Solution
 
gripeCommented:
You'll need to use the Net::SSH perl module to do this..
0
 
shahrahulbAuthor Commented:
no need for net::ssh

system(ssh xxx) worked for me also i did sshykeygen so that i don't have to enter password.

0
 
TintinCommented:
#!/usr/bin/perl
system "ssh abc.com /v/temp/run.pl" and die "Can not run ssh $!\n";
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now