2

I configured a PC with Ubuntu 20.04 to be a database and applications server on our local network. However, as it is a server it will be without keyboard and monitor.

Is it possible to access this Ubuntu server from a macOS computer via SSH with access to its desktop without me having to install software like TeamViewer?

Tom
  • 141

2 Answers2

2

If you just want command-line access, you can SSH in.

If you want to use the graphical desktop environment (with a mouse, etc.), you can use VNC to get in. VNC is a fairly universal de facto standard remote desktop protocol with multiple implementations on all platforms. It is also known as the "Remote Frame Buffer" (rfb) protocol. Ubuntu comes with a VNC server called vino that you can set up from the Ubuntu GNOME desktop environment in System > Preferences > Remote Desktop.

macOS's "Screen Sharing" feature is VNC-based, so you can connect to any VNC-enabled device from macOS by selecting Go > Connect to Server… (Cmd-K) from Finder, and entering a VNC URL like vnc://username@host.example.com/. Or you can launch the Screen Sharing client app:

open /System/Library/CoreServices/Applications/Screen\ Sharing.app

…and then use that app's GUI to tell it to connect to your Ubuntu box.

Spiff
  • 104,423
  • Just for safety. Can I leave the VNC server (Vino) blocked only for my local network? Under no circumstances should it be possible to access it through the internet or computers outside the network (preferably with authorized local IPs). – Tom Jun 23 '22 at 01:34
  • @Tom Sure. I don't see why not. – Spiff Jun 23 '22 at 01:37
  • The best would be to block all incoming requests with UFW and just allow the Vino port to the local network, correct? – Tom Jun 23 '22 at 01:39
  • @Tom I'm not here to give security advice, but that sounds fine. – Spiff Jun 23 '22 at 02:12
  • @Spiff You are getting comments that are “And also this…” questions because you answered a question that should be closed. This question is effectively a question asking for a step-by-step guide which is off-topic. – Giacomo1968 Jun 23 '22 at 12:31
  • @Tom “Under no circumstances should it be possible to access it through the internet…” if the machine is on a local network, none of your additional “And also this…” questions matter at all in any way. No need to do anything else such as set UFW or anything. If it is on your local network and is not accessible outside of your network every port in the world can be open and nobody could reach it. Your logic is like saying, “Before I leave my home, should I lock every door, window and cabinet to be safe?” As long as you lock your front door, and other main points of entry, your home is safe. – Giacomo1968 Jun 23 '22 at 12:53
  • @Giacomo1968 It's a completely valid, in-scope question. Nothing in the wording of the Question can be reasonably interpreted to mean he's looking for a step-by-step guide. He's also not looking for software recs; he was asking if there was already a way to do it without installing additional software like TeamViewer. And there was: VNC. It's clear from his followup comments that he was not aware of VNC or the fact that VNC implementations are built into both Ubuntu and macOS. This is a perfectly good question for SuperUser. – Spiff Jun 23 '22 at 17:20
  • The original poster is clearly fishing for step-by-step help as proven by the comments here that are effectively additional question to the initial question. – Giacomo1968 Jun 23 '22 at 19:15
0

@Spiff's answer worked for me. However, it appears that vino has been deprecated. On Kubuntu 23.04 (which is basically just Ubuntu with the KDE desktop), there was no "Sharing" option on the Settings menu. So I installed krfb (host) and krdc (client) as replacements for vino, and they work fine.

sudo apt-get install krfb krdc

Once installed, an option appeared on the KDE desktop under Settings-->Internet-->krfb to set the Linux box up as a host, or krdc to set it up as a client.

Choose krfb, set a password, and write down the server's URL. Then follow @Spiff's instructions for the Mac.

John
  • 101