我是unix / linux的新手,在尝试将隧道连接到我大学的计算机时遇到了一个问题。
我试图访问我学校网络上的计算机A.但除非我已经在学校网络上,否则无法访问它。我可以ssh到计算机B然后ssh到计算机A.让我们说计算机C只能通过计算机B访问,我如何制作一个可以为我做这个的shell脚本?
到目前为止,我通过B隧道进入计算机A,但无法进入C. 我试过这个
ssh -t user@computerB 'ssh user@computerA' 'ssh user@computerC'
sh -t user@computerB "ssh user@computerA 'ssh user@computerC'"
我做错了什么
答案 0 :(得分:2)
似乎对我有用。显然你必须使用-t来强制每次跳转的ptty分配:
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.