简体   繁体   English

通过互联网访问树莓桌面

[英]access raspberry desktop over internet

I am currently trying to access my raspberry pi over the internet. 我目前正在尝试通过互联网访问我的树莓派。 I hope I can access its desktop in library when my pi is at home. 我希望我的pi在家时可以在图书馆中访问其桌面。

for now, I have managed to access my pi through ssh over the internet, but I don't know how to access the GUI interface. 目前,我已经设法通过ssh通过Internet访问我的pi,但是我不知道如何访问GUI界面。 I downloaded RealVNC Viewer on my PC and use sudo apt-get install realvnc-vnc-server realvnc-vnc-viewer to make VNC available on my pi. 我在PC上下载了RealVNC Viewer,并使用sudo apt-get install realvnc-vnc-server realvnc-vnc-viewer使VNC在我的pi上可用。 the VNC viewer is now working well when I am at home that my pc and pi are in the same Wi-Fi, but it's not working when I'm in library. 现在,当我在家时,我的PC和pi位于同一Wi-Fi中时,VNC查看器运行良好,但是当我在图书馆中时,它无法正常工作。 It gives: Connection refused by the computer. 它给出:连接被计算机拒绝。

I know the IP address of my pi and it's working when I use ssh option, can anyone shed some light on my problem? 我知道我的pi的IP地址,并且在使用ssh选项时可以正常工作,任何人都可以对我的问题有所了解吗? By the way, I have changed my port to, say, 30 in my sshd config file for security reason. 顺便说一句,出于安全原因,我已在sshd配置文件中将端口更改为30。 Would it make any difference when I use vnc? 使用vnc会有所不同吗?

You have at least two options. 您至少有两个选择。 One is to have an X server in your client computer (in the library): Xming is good. 一种是在客户端计算机中(在库中)有一个X服务器:Xming很好。 Then use "ssh -X" from the library computer. 然后从库计算机中使用“ ssh -X”。 The "-X" option does the magic to tunnel the X protocol transparently from the pi to the PC. “ -X”选项的神奇之处在于可以将X协议从pi透明地传输到PC。

The other option is to use vnc, but if your pi is behind a router, you have to "open a port" on the router and forward that port toward your pi. 另一个选择是使用vnc,但是如果您的pi在路由器后面,则必须在路由器上“打开端口”并将该端口转发到pi。 The procedure for doing this is very different from router to router. 路由器之间的操作步骤非常不同。

There are also mechanisms available, in linux/unix, to limit access from outside the internal net (/etc/hosts.***), you should check. 在linux / unix中,还有一些可用的机制可以限制内部网络(/etc/hosts.***)外部的访问,您应该检查一下。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM