How to connect to a server using another server by ssh in shell script? -


the scenario like:

server_a="servera.com" server_a_uname="usera" server_b="serverb.com" server_b_uname="userb" 

i want write shell script fist connect server a, , connected server b. like:

#!/bin/sh ssh $server_a_uname@$server_a ...and ssh $server_b_uname@$server_b 

but not able it. connect server only. how can achieve it?

you may able find previous question:

how use bash/expect check if ssh login works

depending on situation might execute remote ssh command , wait positive feedback.

see:

how use ssh run shell script on remote machine?


Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -