Skip to Content
Linux Networking Cookbook
book

Linux Networking Cookbook

by Carla Schroder
November 2007
Beginner
642 pages
15h 43m
English
O'Reilly Media, Inc.
Content preview from Linux Networking Cookbook

8.21. Securely Tunneling x11vnc over SSH

Problem

x11vnc is great for remote helpdesk and roaming users, but you're not comfortable with sending everything in cleartext. You want to tunnel x11vnc over SSH for secure encryption, so how is this done?

Solution

This example shows you how to tunnel x11vnc over SSH, establishing the tunnel and starting x11vnc with one command. No remote user intervention is needed at all, providing that sshd is running on their PC. Windbag is the local PC, and Stinkpad is the remote machine:

	carla@windbag:~$ ssh -L 5900:windbag:5900 stinkpad 'x11vnc -localhost -display :0'

Then, open a second command shell on the local machine, and connect with this command:

	carla@windbag:~$ vncviewer localhost:0

Just like VNC, you may run as many x11vnc sessions as you want. They are numbered sequentially.

If you don't want to keep your password in a configuration file, and would rather enter it on the command line, use the -passwd flag:

	$ x11vnc -passwd [password] -bg

x11vnc is a stateless connection, so you can log in, log out, wander around, and log in again, picking up where you left off.

x11vnc has many dozens of options; to see a list of them, run:

	$ x11vnc -opts

This command gives long descriptions for each one:

	$ x11vnc -help

Discussion

This should work for any version of VNC.

See Also

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Linux Networking Cookbook

Linux Networking Cookbook

Gregory Boyce
Linux Security Cookbook

Linux Security Cookbook

Daniel J. Barrett, Richard E. Silverman, Robert G. Byrnes

Publisher Resources

ISBN: 9780596102487Errata Page