Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > need to do multiple SSH hops using Perl script.

Reply
Thread Tools

need to do multiple SSH hops using Perl script.

 
 
pradeep nair
Guest
Posts: n/a
 
      11-20-2009
The script must:

1. ssh to system A ,from there ssh to system B & from there ssh to
system C.
2. At system C need to connect to a DB and execute few queries and
create an output file
3. The outfile should be SCpied to Sytem A



Using command ssh -L -T, I am able to end up at System C with perl
command system. Am stuck there as in the output the cursor remains at
system C but I need the script to perform step 2 and 3 as mentioned
above.


Thanks in advance,
pRADEEP
 
Reply With Quote
 
 
 
 
smallpond
Guest
Posts: n/a
 
      11-20-2009
On Nov 20, 4:57*am, pradeep nair <(E-Mail Removed)> wrote:
> The script must:
>
> * *1. ssh to system A ,from there ssh to system B & from there ssh to
> system C.
> * *2. At system C need to connect to a DB and execute few queries and
> create an output file
> * *3. The outfile should be SCpied to Sytem A
>
> Using command ssh -L -T, I am able to end up at System C *with perl
> command system. Am stuck there as in the output the cursor remains at
> system C but I need the script to perform step 2 and 3 as mentioned
> above.
>
> Thanks in advance,
> pRADEEP


You should be using Net::SSH.
 
Reply With Quote
 
 
 
 
Josef Moellers
Guest
Posts: n/a
 
      11-20-2009
pradeep nair wrote:
> The script must:
>
> 1. ssh to system A ,from there ssh to system B & from there ssh to
> system C.
> 2. At system C need to connect to a DB and execute few queries and
> create an output file
> 3. The outfile should be SCpied to Sytem A
>
>
>
> Using command ssh -L -T, I am able to end up at System C with perl
> command system. Am stuck there as in the output the cursor remains at
> system C but I need the script to perform step 2 and 3 as mentioned
> above.


I'd use Expect.
Note that it's not for the faint of heart

Josef
--
These are my personal views and not those of Fujitsu Technology Solutions!
Josef Möllers (Pinguinpfleger bei FTS)
If failure had no penalty success would not be a prize (T. Pratchett)
Company Details: http://de.ts.fujitsu.com/imprint.html
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
need to do multiple SSH hops using Perl script. pradeep nair Perl Misc 1 11-21-2009 03:21 PM
SSH Module: Accessing CLI box using SSH and not getting the return output?? Deepika Perl Misc 2 11-14-2006 04:48 AM
metrics = hops? Gordon J. Rattray Microsoft Certification 3 05-31-2004 08:42 PM
NAT translate past 2 hops? Joseph Finley Cisco 3 01-15-2004 05:07 PM
Gigastack GBICs and STP hops Pete Mainwaring Cisco 1 07-11-2003 11:13 AM



Advertisments