There are two unix servers called HYD13 and HYD25.
I am having a script(in my home dir) in HYD13 which fetches the required data from that server(HYD13) only and all the required data are printed in a text file.
But my requirement is I need to configure the same script in HYD25(in a path) and It will fetch the data from HYD13 server and prints the data in HYD25 server(mentioned path). But the issue is how to connect HYD13 sever from HYD25 inside the script ?
Could you please help me on this ?
Both talk over
ssh, so to avoid having to type in your password over and over again (or worse, hard code it into the script) be sure to use ssh keys and an ssh-agent. This lets you log into servers without needing to type in your password, instead the stored keys are used, and all that is tied to logging into your account. Github has a good tutorial on creating keys and adding them to an ssh-agent. Ubuntu also has a good tutorial which covers ssh in more detail and how to put the key on the remote machine.
Finally, rather than having to put your private keys on HYD13 and HYD25, you can leave those keys on one machine and use ssh key fowarding to use those credentials when you log into HYD13 or HYD25. Again, Github has a nice tutorial on how to do this.