Introduction
In this article, we will explain how to connect to a RealVNC Server running on an Ubuntu server through an intermediate SSH terminal. This setup is useful when you want to securely access your RealVNC Server from an external network.
Prerequisites
Before we begin, make sure the following requirements are met:
- An Ubuntu server with RealVNC Server (paid version) installed.
- SSH access to the Ubuntu server.
Setting up the Connection
To connect to the RealVNC Server via an intermediate SSH terminal, follow these steps:
Step 1: Install the VNC Server on Ubuntu
If you haven't already, install the RealVNC Server on your Ubuntu server. You can download the package from the RealVNC website and install it using the following commands:
sudo dpkg -i realvnc-server_x.x.x-x_all.deb
Step 2: Configure the RealVNC Server
Configure the RealVNC Server to listen on a specific port. Open the RealVNC Server configuration file using:
sudo nano /etc/realvnc/vncserver.conf
Add the following line at the end of the file:
Listen 5901
Step 3: Start the RealVNC Server
Start the RealVNC Server using:
sudo service realvnc-server start
Step 4: Install and Configure SSH
If you haven't already, install OpenSSH server on your Ubuntu server:
sudo apt-get install openssh-server
Configure SSH to allow remote connections. Open the SSH configuration file using:
sudo nano /etc/ssh/sshd_config
Find the line that starts with "PermitRootLogin" and change it to:
PermitRootLogin no
Find the line that starts with "PasswordAuthentication" and change it to:
PasswordAuthentication yes
Save and close the file. Restart the SSH service:
sudo service ssh restart
Step 5: Connect to the Ubuntu Server via SSH
Connect to your Ubuntu server via SSH using an SSH client. For example, you can use PuTTY on Windows or the terminal on Linux:
ssh username@your_ubuntu_server_ip_address
Step 6: Install and Configure TightVNC Server
Install the TightVNC Server on your local machine. You can download the package from the TightVNC website and install it using the following instructions for your operating system.
Step 7: Connect to the RealVNC Server via SSH and TightVNC
Once you have installed TightVNC Server on your local machine, you can connect to the RealVNC Server via SSH and TightVNC. Use the following command in your terminal:
ssh -X username@your_ubuntu_server_ip_address "vncviewer localhost:5901"
In this article, we explained how to connect to a RealVNC Server running on an Ubuntu server through an intermediate SSH terminal. We covered the steps to install and configure the RealVNC Server, SSH, and TightVNC Server. By following these instructions, you can securely access your RealVNC Server from an external network.