2

what is the easy/minimal way to remotely(over the Internet) connect a Ubuntu 20.04 system from another Ubuntu 20.04 system? I have tried team-viewer any-desk in the past.

But is there a native way to remotely(over the Internet) connect a Ubuntu 20.04 to another Ubuntu 20.04 within the Ubuntu's applications/sources/out-of-the-box?

Looking for a step by step practical approach..

PRATAP
  • 22,460
  • you could also use Remmina Remote Desktop Client (GUI) which has 3 different options RDP, VNC and SSH and is already installed on Ubuntu 20.04 – kannzzmm2 Jun 19 '20 at 13:05
  • @kannzzmm2 Ok.. I saw Remmina Remote Desktop is installed. I will go through it.. Thank You!!! – PRATAP Jun 19 '20 at 13:08

2 Answers2

2

ssh

I think it is easy to use ssh. Install openssh-server in [at least] one of the computers, and log in with ssh from the other computer or transfer files with sftp or simply via the file browser.

Several users have found the following link useful in order to run graphical programs via ssh -X,

What is the simplest way to have remote GUI access to Ubuntu 16.04 “server” from Ubuntu 16.04 “desktop”?

sudodus
  • 46,324
  • 5
  • 88
  • 152
  • This method will run in terminal windows and/or open graphical windows in your client computer's desktop envrionment. If you want a virtual desktop there is for example VNC or the tools you describe. But it is not as simple to set up. – sudodus Jun 19 '20 at 13:04
  • If via the internet, you have to set up a good firewall and you should use authentication with keys.That is important, and not quite straightforward, but there is a detailed description at the Ubuntu help pages. – sudodus Jun 19 '20 at 13:09
  • yes via the internet only.. Thanks for the links.. seems I have to spend good time to night to read the links you provided. Thank you somuch.. – PRATAP Jun 19 '20 at 13:10
1

On the system you want to connect to:

  1. install "vino" package. The entry for "Desktop sharing" should appear somewhere in the menu.
  2. You have to set some configuration parameters for vino-server, but probably the only way to do it is via dconf-editor (the GUI to set these parameters has been removed long ago), so you have to install it too if it isn't already installed. In dconf, goto /org/gnome/desktop/remote-access and: a) set authentication-methods to ['vnc'] b) set prompt-enabled to false c) set require-encryption to false d) set vnc-password to base64 encoded value of the password you want to use to connect
  3. Start vino-server by clicking the desktop sharing entry from the menu.

On the other system, use any VNC client (eg. Remmina, which is installed by default) to connect.

raj
  • 10,353
  • Yes, this will work over the Internet if you have either a public IP address or have VNC port (5900) forwarded on your router so that it is available from the Internet. It's like with any service. However, you must keep in mind that this works as long as the GNOME session is logged in and running on the machine you want to access. If you log out or reboot the machine, then access will no longer be possible, as vino-server will stop when you exit the GNOME session. – raj Jun 23 '20 at 12:04
  • I don't know how the target machine (the one you want to connect to) is connected to the Internet, so it's hard for me to help. If you don't know how to determine your machine's IP address, or how to (if needed) forward ports on the router, there's too little space here to describe it. There is a lot of information about it available on the Net, google for "how to determine my IP address" or "how to forward ports on the router". This is not particularly Ubuntu related, this is general network knowledge, so you may try to ask on some networking forum about it. – raj Jun 23 '20 at 17:49
  • I have both the systems located at 400km away. Each have different local internet connections.. both connected with wifi routers at homes.. – PRATAP Jun 24 '20 at 06:58
  • So you need to access the router of the target machine and set on that router forwarding of port 5900 on your machine to the Internet. I can't tell you how exacly to do it because it depends on the router, you need to consult the router manual. You need to know the local (private) IP address of the Ubuntu machine for that, use the command "ifconfig" on target machine. You also need to know the public IP address of that router, you can obtain it by going to https://www.whatismyip.com/ from target machine. Then you should be able to use that IP address in Remmina to connect to your desktop. – raj Jun 24 '20 at 14:01
  • seems promising but I am really afraid of IP addresses.. Is it Ok to test the procedure with below case.. I mean rite now I have two systems.. but with same wifi router.. I mean I am at home with two systems.. is it possible to test your way with this setup? – PRATAP Jun 24 '20 at 14:08
  • To try the procedure, I'd suggest to connect one of the machines temporarily via other connection, eg. a cellular network. You can try to share WiFi from your phone and connect one machine (the one you will be connecting from) to the phone's WiFi and not router's WiFi. – raj Jun 24 '20 at 14:22
  • seems good.. I shall recharge my cellular with unlimited pack and try.. so I will try tomorrow.. Thanks for your support.. I think your answer will be green ticked once I test it.. – PRATAP Jun 24 '20 at 14:24
  • this is the target machine.. and I opened router settings.. I am struck at this page.. https://i.stack.imgur.com/Pz13l.png – PRATAP Jul 06 '20 at 04:25
  • I guess you probably have to type 5900 into the "Service port" field and the private IP address of your target machine into the "IP address" field, but I cannot be 100% sure - you must check with your router manual – raj Jul 06 '20 at 14:54
  • Sharing option is available in Ubuntu 20.04. Doesn't it mean that Vino package is already installed? Or, maybe, it's not needed? I am a newbie regarding remote access over Internet and just have no idea what it is. – ENIAC Oct 13 '20 at 06:52
  • @ENIAC If you have screen sharing option available then you probably don't have to install anything. Is your system a fresh installation or an upgrade? Because on my system (fresh install) it was not available by default, so I wrote in my answr that it should be installed first. – raj Oct 13 '20 at 09:39
  • @raj, in my case, it's a fresh install. However, I wasn't able to connect to my home desktop over Internet. After googling for several days, I think, port forwarding and setting dynamic DNS up are needed first (cannot check it for sure as I'm not at home now). If I'm wrong, correct me, please. I'm just trying to figure out the entire process step-by-step. – ENIAC Oct 13 '20 at 19:44
  • Port forwarding is usually needed, unless you have no router, and your home computer has a public IP address. For dynamic DNS, it depends whether your public IP address is constant or it changes. If it's constant, you just connect to that IP. If it changes then dynamic DNS is a good solution. – raj Oct 13 '20 at 22:16
  • Thank you very much, @raj! I'll try that when will be at home again. – ENIAC Oct 14 '20 at 07:42
  • @raj, I've registered a dynamic DNS. Then, set Dynamic DNS in my router menu. Then, set port forwading: port 5900, internal IP-address of my desktop to which I want to connect (found it in Ubuntu Wi-Fi settings. On the screenshot it shown as 123.456.789.012), protocol ALL (TCP and UDP, I believe). Then, adjucted Remmina VNC settings. But, still I cannot connect. Though, I'm trying to connect from the same desktop (on the same network) as I don't have access to my notebook. Maybe you have some ideas what I'm doing wrong? – ENIAC Oct 17 '20 at 08:53
  • Hmmm... it looks like No-IP changes IP address to public one every 10 or so minutes and then I cannot connect to my desktop. Don't know what to do. – ENIAC Oct 17 '20 at 10:15
  • Also, internet services that check whether ports are closed or open show that all my ports closed. – ENIAC Oct 17 '20 at 11:04
  • ping somename.ddns.net doesn't work either :( – ENIAC Oct 17 '20 at 11:25
  • Either firewall settings on your router, or firewall settings on your Ubuntu machine, or even your ISP doesn't allow connections from outside. It requires more thorough investigation on networking level; I cannot help you with that through a forum post. – raj Oct 17 '20 at 14:10
  • OK. Seems that AnyDesk application or something like that should be used. Anyway, thank you, @raj. – ENIAC Oct 17 '20 at 15:46
  • Further investigation shows that it may have something to do with a gray IP address. – ENIAC Oct 17 '20 at 16:25