Linux 类似teamviewer 的ssh 工具?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5458311/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-05 03:25:37  来源:igfitidea点击:

teamviewer-like tool for ssh?

linuxsshnat

提问by Claudiu

I want to access my home computer from work through SSH, but the problem is my home computer is behind a NAT router (which I don't have access to). Because my work computer has a CentOS installed and is behind a proxy, I couldn't use TeamViwer (TV is ported on Linux with wine, and apparently proxy settings won't work).

我想通过 SSH 从工作中访问我的家用计算机,但问题是我的家用计算机位于 NAT 路由器(我无权访问)后面。因为我的工作计算机安装了 CentOS 并且在代理后面,所以我无法使用 TeamViwer(电视在带有 wine 的 Linux 上移植,显然代理设置不起作用)。

Does anyone has knowledge of a program that would suit my needs?

有没有人知道适合我需要的程序?

Thanks, Claudiu

谢谢,克劳迪乌

采纳答案by PMD

[1] Tool itself - i'd recommend taking look at jrdesktop [ http://jrdesktop.sourceforge.net/]; though not very active project and not particualry suited for modem-like connections, it is stable, reliable, multiplatform and works fine.

[1] 工具本身 - 我建议看看 jrdesktop [ http://jrdesktop.sourceforge.net/]; 虽然不是很活跃的项目,也不是特别适合类似调制解调器的连接,但它稳定、可靠、多平台并且运行良好。

[2] Both jrdekstop and ssh, while not doing NAT-transversal (like Hamachi - so called zero configuration VPN; be sure to check this one! https://secure.logmein.com/products/hamachi2/), have options like "reverese connection" that you might find useful.

[2] jrdekstop 和 ssh,虽然不做 NAT-transversal(比如 Hamachi - 所谓的零配置 VPN;一定要检查这个!https://secure.logmein.com/products/hamachi2/),有像您可能会觉得有用的“反向连接”。

Once you establish such VPN between machines, you are free to use ssh,X,RDP,jrdesktop,VNC and other tools of your choice as you would in normal LAN. If you don't trust third party "transversal provider", I heared that it's relatively easy to write your own counterpart to such software (still, at least one of machines must be public, or both NAT-ed must have temporary access to public third machine).

一旦你在机器之间建立了这样的 VPN,你就可以像在普通局域网中一样自由地使用 ssh、X、RDP、jrdesktop、VNC 和其他你选择的工具。如果您不信任第三方“横向提供商”,我听说编写您自己的此类软件的副本相对容易(仍然,至少一台机器必须是公共的,或者两个 NAT-ed 必须临时访问公共第三台机器)。

Also, people at serverfault.com might offer better insights.

此外,serverfault.com 上的人可能会提供更好的见解。

回答by Martin Ueding

You might be able just to use X forwarding with ssh -X hostor ssh -Y hostand just open graphical applications. Or you set up a VNC server that you could tunnel trough SSH as well.

您可能只能将 X 转发与ssh -X hostssh -Y host仅打开图形应用程序一起使用。或者您设置一个 VNC 服务器,您也可以通过 SSH 进行隧道传输。

回答by BadFileMagic

I don't know if you mean you don't have external-net remote management of your home router, or if someone else keeps the password, but, if you can get access to your router you should likely be able to set up port forwarding so that when you ssh to the public-facing ip of the router, it will automatically send all ssh traffic to a box on the inside network.

我不知道您的意思是您的家庭路由器没有外部网络远程管理,还是其他人保留了密码,但是,如果您可以访问您的路由器,您应该可以设置端口转发以便当您 ssh 到路由器的面向公众的 ip 时,它会自动将所有 ssh 流量发送到内部网络上的一个盒子。

Unless your ISP is doing something dastardly with carrier-grade NAT, that should work just fine.

除非您的 ISP 使用运营商级 NAT 做一些卑鄙的事情,否则它应该可以正常工作。

Alternatively, you should be able to connect from home to your work machine via ssh and create a tunnel so that you can shell to your work machine and then grab the session between home and work.

或者,您应该能够通过 ssh 从家中连接到您的工作机器并创建一个隧道,以便您可以通过 shell 连接到您的工作机器,然后获取家庭和工作之间的会话。

回答by Sonia Hamilton

From the sounds of it, there's no particular "application" that's going to solve your problem, it's more of a networking issue - your home computer is behind NAT and your work computer is behind a proxy (http or socks).

从它的声音来看,没有特定的“应用程序”可以解决您的问题,更多的是网络问题-您的家用计算机位于 NAT 之后,而您的工作计算机位于代理(http 或 socks)之后。

So you need a third computer - preferably running Linux or BSD - call it "third-pc". A cheap Linux vps hosting is probably the best way to go.

所以你需要第三台电脑——最好是运行 Linux 或 BSD——称之为“第三台电脑”。便宜的 Linux vps 主机可能是最好的方法。

From your work computer, you can use "connect" in your ssh configuration to tunnel through the proxy to "third-pc" - see http://bent.latency.net/bent/git/goto-san-connect-1.85/src/connect.html.

在您的工作计算机上,您可以在 ssh 配置中使用“connect”通过代理隧道连接到“third-pc” - 请参阅http://bent.latency.net/bent/git/goto-san-connect-1.85/ src/connect.html

For example, here is an entry I have in my ~/.ssh/config:

例如,这是我在 ~/.ssh/config 中的一个条目:

Host foo.dyndns.org
    User sonia
    Port 443
    ProxyCommand connect -H 1.2.3.4:8080 %h %p

(Using port 443 is a common way to get around http proxies).

(使用端口 443 是绕过 http 代理的常用方法)。

From your home computer, you can use "autossh" to setup a persistent tunnel to "third-pc" - see http://www.harding.motd.ca/autossh/and http://www.linux.com/archive/feature/134133

在您的家用计算机上,您可以使用“autossh”设置到“第三台电脑”的持久隧道 - 请参阅http://www.harding.motd.ca/autossh/http://www.linux.com/archive /功能/134133

From your work computer, you can then ssh up to "third-pc", then back down the autossh tunnel to your home computer.

在您的工作计算机上,您可以通过 ssh 连接到“第三台电脑”,然后将 autossh 隧道返回到您的家用计算机。

回答by Ben Voigt

NX uses ssh transport. NoMachine distributes both free and premium versions of the tool, and there's also freenx.

NX 使用 ssh 传输。NoMachine 分发该工具的免费和高级版本,还有 freenx。

回答by formigarafa

You could also use an alternative like Robo-TiTO. This make your server accessible by Jabber chat, (GTalk/Hangouts) for example. It is a pretty simple and straight-forward terminal access. I've been using for a few years. I usually open a reverse SSH tunnel with it and after that it is just a proper SSH access.

您也可以使用Robo-TiTO等替代品。这使您的服务器可以通过 Jabber 聊天(例如 GTalk/环聊)访问。这是一个非常简单和直接的终端访问。我已经用了几年了。我通常用它打开一个反向 SSH 隧道,然后它只是一个适当的 SSH 访问。

回答by valentt

I have been looking for same thing and have found two tools!

我一直在寻找同样的东西,并找到了两个工具!

  • tmate- instant terminal sharing
  • GoTTY- Share your terminal as a web application
  • tmate- 即时终端共享
  • GoTTY- 将您的终端作为 Web 应用程序共享

tmate: When you start tmate in your terminal it will create a ssh link that you can to share with other party that you wish to allow connecting to your terminal session. Other party just need to have ssh installed.

tmate:当您在终端中启动 tmate 时,它​​会创建一个 ssh 链接,您可以与您希望允许连接到终端会话的其他方共享该链接。对方只需要安装ssh。

Works trough NATs without problem, no 3rd party tool is needed.

可以毫无问题地通过 NAT 工作,不需要第 3 方工具。

tmate ssh links look like this:

tmate ssh 链接如下所示:

ssh [email protected]

ssh [email protected]

Just install tmate on your system, there are packages in official repositories for almost all major distros (Fedora, Debian, Arch, Ubuntu...)

只需在您的系统上安装 tmate,几乎所有主要发行版(Fedora、Debian、Arch、Ubuntu...)的官方存储库中都有软件包

GoTTY: Share any terminal app you wish and other party doesn't even need to have ssh, but you need to sort out port forwarding if you are behind a firewall and NAT.

GoTTY:共享任何你想要的终端应用程序,其他方甚至不需要 ssh,但如果你在防火墙和 NAT 后面,你需要整理端口转发。

回答by hailinzeng

If you only need an ssh connection, you can spend 2.99$/month to buy a cheap vps, and use reverse ssh or ngrok to logging your computer behind NAT.

如果你只需要一个 ssh 连接,你可以花 2.99 美元/月购买一个便宜的 vps,并使用反向 ssh 或 ngrok 将你的计算机记录在 NAT 后面。

回答by Onlyjob

Remote shell access:

远程外壳访问:

  • Teleconsole- Command line tool to share your UNIX terminal and forward local TCP ports
  • Tmate- Instant Terminal Sharing
  • Teleconsole- 共享 UNIX 终端和转发本地 TCP 端口的命令行工具
  • Tmate- 即时终端共享

Remote GUI access over SSH:

通过 SSH 进行远程 GUI 访问:

  • Xpra- multi-platform screen and application forwarding system "screen for X11"
  • Xpra——多平台屏幕和应用转发系统“X11的屏幕”