0

I would like to excute a shell script on a remote unix server. Now, I dont have direct connectivity to this server. I must go through jumphost which is also unix box. I want to make a batch file which execute the script on the remote server in one go. Below diagram may help to understand this better.

Local Machine-->Jumphost (Unix box)-->Remote unix server-->execute shell script

My batch job will connect to jumphost using telnet and then it should connect to remote server and execute the script.

How to do this in "one" go ??

1 Answer 1

2

You could use a ProxyCommand with SSH.

In your ssh config (~/.ssh/config):

Host remotehost.com
   ProxyCommand ssh [email protected] -W %h:%p

Then execute the command:

ssh remotehost.com 'shellscript.sh'
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .