Difficulty: ★★☆☆☆
VNC
VNC is a protocol where you use your keyboard/mouse/screen to monitor or control a remote system.
VNC is per definition insecure
Opening a VNC service onto insecure networks like the internet, public libraries, internet cafès etc. may lead to information leaking and/or attempts to take control of your system.
It is highly recommended to only expose VNC to the localhost and connect using a secure connection using SSH or VPN.
TigerVNC Limitations
Multiple X sessions for a single user are not supported
– TigerVNC - ArchWiki
This effectively means - if you are logged onto the physical display :0
then you cannot connect a vnc session. If you try to do so, using the same username, a black screen or system lockup will be the likely result.
In that regard it works like Microsoft RDP which logout the physical session when you initiate a remote connection and vice-versa.
Target system
On the system to be controlled install package tigervnc
VNC password
Create a password for your login
vncpasswd
Configuration
Session
List the available sessions
ls /usr/share/xsessions
Create the file /home/$USERNAME/.vnc/config
with content (replace $SESSION according to your installation e.g. openbox, plasma, lxqt).
session=$SESSION
Display configuration
Edit /etc/tigervnc/vncserver.users
and append e.g. :4
- which in turn will correspond to port 5904 - replace $USERNAME with the user you just created the password for.
:4=$USERNAME
Start the vncserver service for the selected display
systemctl enable vncserver@:4
Logout or restart the system.
Controlling system
Install the package tigervnc
Connect
Connect using the command line
vncviewer ip.a.b.c:5904 &
Authenticate
Input the password created earlier and you will see the remote system.