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
List of Top Ranking Musicians in Africa 2024
The Co-operative Bank | Banking Services
Fighter Torso Ornament Kit
NOAA: National Oceanic &amp; Atmospheric Administration hiring NOAA Commissioned Officer: Inter-Service Transfer in Spokane Valley, WA | LinkedIn
Umbc Baseball Camp
Housing near Juneau, WI - craigslist
The Potter Enterprise from Coudersport, Pennsylvania
Craigslist Kennewick Pasco Richland
Zitobox 5000 Free Coins 2023
Localfedex.com
Ucf Event Calendar
Savage X Fenty Wiki
Aquatic Pets And Reptiles Photos
Simple Steamed Purple Sweet Potatoes
Cvs Learnet Modules
What to do if your rotary tiller won't start – Oleomac
Youravon Comcom
Are They Not Beautiful Wowhead
Abortion Bans Have Delayed Emergency Medical Care. In Georgia, Experts Say This Mother’s Death Was Preventable.
Roll Out Gutter Extensions Lowe's
Why Should We Hire You? - Professional Answers for 2024
BMW K1600GT (2017-on) Review | Speed, Specs & Prices
The Ultimate Guide to Extras Casting: Everything You Need to Know - MyCastingFile
Cincinnati Adult Search
Governor Brown Signs Legislation Supporting California Legislative Women's Caucus Priorities
Craigslist St. Cloud Minnesota
Www.paystubportal.com/7-11 Login
Construction Management Jumpstart 3Rd Edition Pdf Free Download
T Mobile Rival Crossword Clue
Yugen Manga Jinx Cap 19
EVO Entertainment | Cinema. Bowling. Games.
Copper Pint Chaska
Xpanas Indo
Buhl Park Summer Concert Series 2023 Schedule
Bend Missed Connections
Japanese Emoticons Stars
Devotion Showtimes Near The Grand 16 - Pier Park
Boneyard Barbers
Agematch Com Member Login
Myanswers Com Abc Resources
Miami Vice turns 40: A look back at the iconic series
Parent Portal Pat Med
Anthem Bcbs Otc Catalog 2022
Cleveland Save 25% - Lighthouse Immersive Studios | Buy Tickets
Market Place Tulsa Ok
Aurora Southeast Recreation Center And Fieldhouse Reviews
Gander Mountain Mastercard Login
Random Warzone 2 Loadout Generator
Cars & Trucks near Old Forge, PA - craigslist
Joe Bartosik Ms
Jesus Calling Oct 6
Dinargurus
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.