Im fairly new to unix/linux and have a question while trying to ssh tunne开发者_StackOverflow中文版l to a computer at my college.
Im trying to access computer A which is on my school network. But it cannot be accessed unless i am already insice the school network. I can ssh into computer B and then ssh into computer A. Lets say computer C is only accessible via computer B, how would i make a shell script that would do this for me?
So far i tunneled to computer A via B but cannot get to C. I tried this
ssh -t user@computerB 'ssh user@computerA' 'ssh user@computerC'
sh -t user@computerB "ssh user@computerA 'ssh user@computerC'"
What am i doing wrong
Seems to be working for me. Apparently you have to use -t to force ptty allocation for each jump:
jcomeau@intrepid:~/rentacoder/peppe/dentalcam$ ssh -t www "ssh -t tek 'ssh -t www'"
Linux unixshell.jcomeau.com 2.6.18.8 #1 SMP Mon Nov 22 15:26:09 EST 2010 i686 GNU/Linux
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
No mail.
Last login: Thu Jul 7 02:03:30 2011 from c-76-103-110-80.hsd1.ca.comcast.net
jcomeau@unixshell:~$ logout
Connection to www closed.
Connection to tek closed.
Connection to www closed.
精彩评论