need to do multiple SSH hops using Perl script.

Discussion in 'Perl Misc' started by pradeep nair, Nov 20, 2009.

  1. pradeep nair

    pradeep nair Guest

    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
     
    pradeep nair, Nov 20, 2009
    #1
    1. Advertising

  2. pradeep nair

    smallpond Guest

    On Nov 20, 4:57 am, 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.
    >
    > Thanks in advance,
    > pRADEEP


    You should be using Net::SSH.
     
    smallpond, Nov 20, 2009
    #2
    1. Advertising

  3. 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
     
    Josef Moellers, Nov 20, 2009
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ttt
    Replies:
    5
    Views:
    1,154
    red floyd
    Jan 25, 2010
  2. ghause

    Trying to work around double hops

    ghause, Apr 6, 2009, in forum: ASP .Net Security
    Replies:
    0
    Views:
    679
    ghause
    Apr 6, 2009
  3. Calvine Chew

    Remote uploading with hops?

    Calvine Chew, Apr 28, 2004, in forum: Perl Misc
    Replies:
    3
    Views:
    90
    Calvine Chew
    Apr 30, 2004
  4. Deepika
    Replies:
    2
    Views:
    221
    Deepika
    Nov 14, 2006
  5. pradeep nair
    Replies:
    1
    Views:
    223
    Martijn Lievaart
    Nov 21, 2009
Loading...

Share This Page