Difference between revisions of "How to connect securely to VNC session via ssh"

From PeerFreedom Wiki
Jump to navigation Jump to search
 
Line 6: Line 6:
  
 
<pre>
 
<pre>
ssh -L -N 15900:localhost:5900 <username>@<hostname>
+
ssh -N -L 15900:localhost:5900 <username>@<hostname>
 
</pre>
 
</pre>
  
 
Then open VNC client in your client machine and use <code>localhost:15900</code> to make a tunnelled VNC connection to the server.
 
Then open VNC client in your client machine and use <code>localhost:15900</code> to make a tunnelled VNC connection to the server.

Latest revision as of 11:17, 20 March 2020

You will need ssh access to the VNC server, as well as VNC client. We are recommending Remmina. (apt-get install remmina remmina-plugin-vnc in debian)

First, establish secure SSH tunnel to your VNC server. Tunnel will listen for port 5900 in the server, which is default port for VNC. In client, it can be configured to listen to any port. We will use 15900 for example.

Run command:

ssh -N -L 15900:localhost:5900 <username>@<hostname>

Then open VNC client in your client machine and use localhost:15900 to make a tunnelled VNC connection to the server.