TELCO has asked for the wisdom of the Perl Monks concerning the following question:

Dear All, :) Sorry my poorly english :( I made script of test to connect to me by means of SSH2 from a server to another one and to execute commands in the second server and that walked to me perfectly. It would need to know if he is possible to make something that I need. In server_A I have script main to make backups of several Cisco routers by means of telnet. It would have to connect to me by SSH2 to a second Server_B and of server_B to connect to me by SSH2 to a Server_C (recursive jump of SSH2 would be second). Server_C is from where it is reached about telnet to this routers since they are filtering the telnet by means of an access list (ACL) stops to the rest of the world by security issue. The Server_A executes script locally but the commands would have them to happen to the sessions that are begun in the Server_c by means of the telnet to the equipment. This is possible to be made in Perl? Greetings and thanks, Telco
  • Comment on SSH2 Recursive conection to Servers ( Cisco Backups routers )

Replies are listed 'Best First'.
Re: SSH2 Recursive conection to Servers ( Cisco Backups routers )
by NetWallah (Canon) on Feb 21, 2008 at 03:52 UTC
    I'm not sure if I completely understood your question, but it appears you are looking for the Net::Telnet and the Net::Telnet::Cisco modules.

    These will enable you to access the router from an ACL-permitted server. Additional SSH, FTP or alternative could get the data to the destination server.

         "As you get older three things happen. The first is your memory goes, and I can't remember the other two... " - Sir Norman Wisdom

      Hi NetWallah / all , I need connect via SSH2 at one server called "Server_A" .This first step is OK :) In the server_A , I need connect to Server_B via SSH2 ... I canīt connect at the second server in my Perl script Have any connection example of a recursive via SSH2 server to another? Is that the script connects to a first server_A and then jump to a server_B by SSH2. This is possible in PERL? Thanks in advance, Best Regars TELCO
        Sorry - I have no experience in SSH tunneling, or chaining (or relay), which is what you appear to want to do.

        If you have a functional SSH script that connects to Server_A, you should be able to run the standard "ssh" command at Server_A and connect to Server_B. You will need to pipe the STDIN and STDOUT back to the originating program. See IPC::Open3.

        Also, if you post some code, and explain the errors, perhaps monks here can help you debug the code.

             "As you get older three things happen. The first is your memory goes, and I can't remember the other two... " - Sir Norman Wisdom

Re: SSH2 Recursive conection to Servers ( Cisco Backups routers )
by zentara (Cardinal) on Feb 21, 2008 at 15:40 UTC