How to Use VNC with SSH Tunnel to Access a Linux Machine (2024)

How to Use VNC with SSH Tunnel to Access a Linux Machine (1) Zheng Xing -

VNC (Virtual Network Computing) has been used as the mainstream method for accessing a Linux machine's desktop environment remotely for more than a decade. There is an alternative called SPICE which brings some advantages and disadvantages compared to VNC. Neither VNC nor SPICE can stream the graphics as smooth as the Microsoft RDP in our experience so far. But having VNC is better than nothing when your computing experiments can benefit from having some visualizations, for example deep reinforcement learning experiments with video games. This article will show you how to set up a VNC viewer/client on your local computer to access a Linux machine provided by the Hanlon Financial Systems Laborotaries (Hanlon Labs) as an example. The SSH tunnel is required because we typically don't not allow VNC connections without encryptions.

If your local computer is a Linux (for example Ubuntu) machine, Remmina is recommended as the VNC client.

Before you can access a machine provided by the Hanlon Labs through VNC and SSH tunnel, you will need to receive the following information and confirmation from the administrators.

  1. VNC server IP/Hostname and port number.
  2. VNC server username and password if password is set in the VNC server. In the example below, password is not set in the VNC server.
  3. Your public key has been deployed into the remote Linux machine for SSH authentication. We, by default, do not enable password authentication for SSH for better security.
  4. Your username and password of the remote Linux machine. Your Linux user needs to have password enabled because you will need it to unlock the screen when it is locked. This is adding a layer of security when VNC is enabled.

Next, you will need to put "localhost:5900" in the Server of Basic tab. The localhost means you are connecting to a VNC server that is listening on "localhost" because, after the SSH tunnel is established, your local computer and the remote Linux machine will be connected as one "localhost". The port number 5900 needs to be replaced with the VNC port number you received from the administrator. The Username and User password will be empty in this example.

How to Use VNC with SSH Tunnel to Access a Linux Machine (2)

In the SSH Tunnel tab, click on "Enable SSH tunnel" and put the hostname or IP of the remote Linux machine in the "Custom" followed by ":22" which is the default SSH port. Since your user is ready to use key pair authentication in the remote Linux machine, you can put your username received from the administrator and specify the path to your SSH private key file and check the box for "SSH private key file".

How to Use VNC with SSH Tunnel to Access a Linux Machine (3)

Click on "Save and Connect" and you should see a window with the remote desktop environment in it. Sometimes you will need to "Toggle scaled mode" in Remmina because the resolution on the remote Linux machine is too high or too low for your local computer.

How to Use VNC with SSH Tunnel to Access a Linux Machine (2024)

FAQs

How do I connect to a Linux machine using VNC? ›

Steps to Use VNC to Access a Remote Linux Server
  1. Install desktop environment on the Remote Linux Server. In this tutorial, we will use the Ubuntu 20 operating system. ...
  2. Install VNC on the Remote Linux Server. ...
  3. Configure the VNC Server. ...
  4. Install VNC viewer on your local computer. ...
  5. Connect to the VNC Desktop Securely.

How to connect VNC via SSH? ›

Connecting to VNC through SSH Port Forward
  1. First, set up the SSH tunnel with the following command. ...
  2. Then, in VNC Viewer, in the “VNC Server” field, instead of entering the remote host's IP address, enter localhost:<local-port> , where <local-port> is the local port you used in the SSH command.
  3. Click “Connect.”

How do I connect to a Linux machine via SSH? ›

Connect to a Linux server via SSH
  1. Open the list of your servers and click on the one you need. Click the Instructions button. ...
  2. Open a terminal (for Linux) or a command line (for Windows) on your computer. Enter the command: ...
  3. The connection will prompt you for a password. Enter the password from the instructions.

What is the difference between VNC and SSH? ›

Unlike text-based protocols like SSH or Telnet, VNC provides full graphical desktop access. Users can view the entire desktop, open and interact with applications, and perform tasks as if they were sitting in front of the remote machine.

How to run VNC server from command line? ›

How to Start VNC Manually
  1. Become superuser or assume the root role.
  2. Start the VNC server. # /usr/bin/vncserver.
  3. Enter the VNC server password. ...
  4. From another machine, run the vncviewer command with the address reported by the vncserver command. ...
  5. Type the password you provided to the vncserver script.

How do I connect to a Linux virtual machine? ›

Connect to a VM using SSH from an OpenSSH client, do the following:
  1. Add an SSH key to the VM if you haven't already.
  2. In the Google Cloud console, go to the VM Instances page and find the external IP address of the VM that you want to connect to. ...
  3. Open a terminal on your workstation.

How to remotely access computer with SSH? ›

How to Connect to a Remote Server via SSH from Windows, Linux or Mac
  1. Change the Default TCP Listening Port.
  2. Use SSH Key Pairs for Authentication.
  3. Disable Password-Based Logins on Your Server.
  4. Disable Root Access.
  5. Use TCP Wrappers.
  6. Secure Login Information and Employ Multilayer Security.
Nov 23, 2023

Do you need SSH for VNC? ›

The SSH tunnel is required because we typically don't not allow VNC connections without encryptions. If your local computer is a Linux (for example Ubuntu) machine, Remmina is recommended as the VNC client.

How to connect VNC Viewer through PuTTY? ›

Resolution
  1. Type vncserver and press Enter.
  2. If it asks for a password, give it a password, hit Enter, and retype the password to verify.
  3. When asked to enter a view-only password select y or n and proceed.
  4. It should read New 'X' desktop is <ServerName> : <Port>
Mar 3, 2020

How to connect to a Linux machine remotely? ›

Accessing a remote Linux machine through CUI (Character User Interface) SSH (Secure Shell) is a straightforward alternative for accessing Linux remotely. An SSH connection can easily be established directly from the Linux terminal shell or through an SSH client. SSH is a widely known open-source protocol.

How to enable SSH access in Linux? ›

To Set Up SSH on Linux systems
  1. Ensure that the following options in the configuration file /etc/ssh/sshd_config are set to yes: StrictModes. ...
  2. Determine if the SSH server daemon sshd is running. $ /sbin/service sshd status.
  3. If the SSH server daemon sshd is not running, start this daemon.

How do I log into a Linux machine with SSH key? ›

Once your SSH key pair is generated, you need to place the public key on the server.
  1. Use the command `ssh-copy-id user@your_server_ip` to copy the public key. Replace `user` with your username and `your_server_ip` with your server's IP address.
  2. Enter your password when prompted.
Jul 10, 2019

Is VNC obsolete? ›

Misconception: VNC technology is outdated

VNC technology was developed over 20 years ago, but it has significantly evolved. VNC Connect is monitored and updated regularly to fix any bugs and to address customer needs as they change with the times.

What is the difference between SSH and SSH tunnel? ›

The SSH connection is used by the application to connect to the application server. With tunneling enabled, the application contacts to a port on the local host that the SSH client listens on. The SSH client then forwards the application over its encrypted tunnel to the server.

How do I connect to VNC? ›

Connecting using RealVNC Viewer
  1. If you have installed RealVNC, then open the VNC Viewer application.
  2. Then create a new connection via File -> New connection menu.
  3. In the next window enter the IP address in the VNC Server field and, after a colon, port. ...
  4. Then initiate the connection by double-clicking on it.

How to open VNC port in Linux? ›

VNC ports to open in Linux
  1. Go to the Router's Web Interface.
  2. Select the Port Forwarding section.
  3. Enter your source and destination port (TCP 5900) for creating the new rule for port forwarding.
  4. Give the local machine's IP as your destination address.
  5. Finally, check if the port is listening or not.
Sep 30, 2021

Top Articles
How to Add Data Visualization to an Excel Sheet + A Painless Alternative
SoFi's Guide to Crypto
No Hard Feelings (2023) Tickets & Showtimes
Walgreens Pharmqcy
Access-A-Ride – ACCESS NYC
Tesla Supercharger La Crosse Photos
Kokichi's Day At The Zoo
Ymca Sammamish Class Schedule
Noaa Swell Forecast
Goteach11
Carter Joseph Hopf
Scentsy Dashboard Log In
Day Octopus | Hawaii Marine Life
Lantana Blocc Compton Crips
Facebook Marketplace Charlottesville
Robert Malone é o inventor da vacina mRNA e está certo sobre vacinação de crianças #boato
Alaska: Lockruf der Wildnis
Wildflower1967
Directions To O'reilly's Near Me
104 Whiley Road Lancaster Ohio
Gayla Glenn Harris County Texas Update
Aldi Bruce B Downs
Acts 16 Nkjv
Keci News
Craigs List Tallahassee
Craigslistodessa
48 Oz Equals How Many Quarts
2487872771
Scripchat Gratis
Lexus Credit Card Login
Local Collector Buying Old Motorcycles Z1 KZ900 KZ 900 KZ1000 Kawasaki - wanted - by dealer - sale - craigslist
Craigslist Ludington Michigan
Truck from Finland, used truck for sale from Finland
Barbie Showtimes Near Lucas Cinemas Albertville
Allegheny Clinic Primary Care North
Craigslist Scottsdale Arizona Cars
100 Million Naira In Dollars
Palmadise Rv Lot
Strange World Showtimes Near Atlas Cinemas Great Lakes Stadium 16
Rocketpult Infinite Fuel
Craigslist Neworleans
Gwu Apps
Space Marine 2 Error Code 4: Connection Lost [Solved]
Temu Y2K
„Wir sind gut positioniert“
303-615-0055
About My Father Showtimes Near Amc Rockford 16
Home Auctions - Real Estate Auctions
If You're Getting Your Nails Done, You Absolutely Need to Tip—Here's How Much
Kenner And Stevens Funeral Home
Wilson Tire And Auto Service Gambrills Photos
Craigslist Pet Phoenix
Latest Posts
Article information

Author: Delena Feil

Last Updated:

Views: 6277

Rating: 4.4 / 5 (65 voted)

Reviews: 80% of readers found this page helpful

Author information

Name: Delena Feil

Birthday: 1998-08-29

Address: 747 Lubowitz Run, Sidmouth, HI 90646-5543

Phone: +99513241752844

Job: Design Supervisor

Hobby: Digital arts, Lacemaking, Air sports, Running, Scouting, Shooting, Puzzles

Introduction: My name is Delena Feil, I am a clean, splendid, calm, fancy, jolly, bright, faithful person who loves writing and wants to share my knowledge and understanding with you.