Aug 24, 2012, 4:30 AM
Post #1 of 2
How to do ssh connection from client-to-remote machine1-to-remote machine2-to-remote machine3 and execute command on remote machine3
I am working on an automation scenario, where the steps mentioned below are to be performed;
1. Script has to run on client machine.
2. Using the Perl script on client machine, we need to login to remote machine-1 using ssh protocol.
3. From remote machine-1, the script should login to other remote machine-2 using ssh protocol.
4. From remote machine-2, the script should login to other remote machine-3 using ssh protocol and execute a command, collect the output.
Here limitations is we cannot directly contact remote machine-3 from client and our script should not create any copies of code on any of the remote machine used in the scenario.
I am a Perl beginner and explored Net::OpenSSH module, but came to know that, using this we can connect only to client -to- remote machine-1.
Any thoughts/example code to handle this scenario.