linux - Remote ssh through multiple machines -
i trying ssh machine machine b , execute ssh command machine b onto machine c execute command on machine c, in 1 step machine a. not working after machine b. getting stuck there. output shown below:
[root@a ~]# ssh -t -t root@192.168.40.152 << eof ssh -t -t root@192.168.40.153 << hk hostname hk eof root@192.168.40.152's password: ssh -t -t root@192.168.40.153 << hk hostname hk last login: fri apr 14 08:53:33 2017 192.168.40.151 [root@b ~]# ssh -t -t root@192.168.40.153 << hk > hostname > hk root@192.168.40.153's password: redhat
it stopping @ above point , not executing command 'hostname' on machine c.
appreciate help.
thanks
you can try
ssh -j root@192.168.40.152 root@192.168.40.153 "hostname"
this proxyjump through 192.168.40.152 , execute hostname command on 192.168.40.153.
please note need have @ least openssh version 7.3 in order have -j option.
Comments
Post a Comment