15.3.3. Connecting to VNC Server Using SSH


VNC is a clear text network protocol with no security against possible attacks on the communication. To make the communication secure, you can encrypt your server-client connection by using the -via option. This will create an SSH tunnel between the VNC server and the client.
The format of the command to encrypt a VNC server-client connection is as follows:
Copy to Clipboard Toggle word wrap
vncviewer -via user@host:display_number

Example 15.6. Using the -via Option

  1. To connect to a VNC server using SSH, enter a command as follows:
    Copy to Clipboard Toggle word wrap
    $ vncviewer -via joe@192.168.2.101 127.0.0.1:3
  2. When you are prompted to, type the password, and confirm by pressing Enter.
  3. A window with a remote desktop appears on your screen.
For more information on using SSH, see Chapter 14, OpenSSH.
Back to top
Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2025 Red Hat, Inc.