通过外部服务器在防火墙后面的两台计算机上进行 SSH 连接
我在一所大学拥有两台电脑。它们都位于某种防火墙等后面,这不允许我通过网络直接连接它们。他们都可以通过 SSH 公用计算机,但我不知道如何从一台计算机到另一台计算机。我还经营一个小网站。我的问题是,我可以使用我网站的公共地址以某种方式连接我的两台计算机,而不会让所有信息流过我的网站并占用我的所有带宽吗?理想情况下,我想在两台计算机之间创建一个 ssh 隧道。
我已经尝试过 Hamachi,它在 Mac 上运行得不太好,我想要对连接有更多的控制。
I own two computers at a University. Both of them are behind some sort of firewall etc. which disallows me to directly connect them over the network. They can both SSH public computers, but I can't figure out how to ssh from one to the other. I also run a small website. My question is, can I use the public address of my website to somehow connect my two computers without all the information flowing through my website and eating all my bandwidth? Ideally I'd like to create a ssh tunnel between my two computers.
I've already tried Hamachi, it doesn't play well with macs anymore and I'd like more control over the connection.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
假设您想通过 ServerC(您的公共服务器)从 MachineA 到 MachineB(都在大学)。
您需要在 ServerC 和 MachineB 上运行 sshd。
运行以下命令,假设您的 sshd 正在侦听 MachineB 和 ServerC 上的端口 22:
此方法只需要访问端口 22,如果您的大学代理是邪恶的,您可以轻松地将其更改为 80 或 443。
Let's assume you want to ssh from MachineA to MachineB (both at the university) by going through your ServerC (your public server).
You will need to run sshd on the ServerC and on MachineB.
Run the following commands, assuming your sshd is listening on port 22 on MachineB and ServerC :
This method only needs access to the port 22, and you can easily change this to 80 or 443 if your university proxy is evil.