Sei sulla pagina 1di 6

Faculty of Applied Sciences

VNC connection through SSH tunnel

VNC connection through SSH tunnel


Connect to Linux server oak.fas.sfu.ca and run vncserver command. You will be ask to type password and to verify it.

Figure 1

Now run vncserver command one more time and output of the second time run command will show you on which port server expects your connection (that is highlighted on our example, we are only interested in number. Its 29 for me, for you it will be different)

Figure 2

Sinisa Milosavljevic

Page 1

Faculty of Applied Sciences Now open Edit Settings

VNC connection through SSH tunnel

Figure 3

Click on Tunneling and make sure Outgoing tab is selected and click on Add

Figure 4

Sinisa Milosavljevic

Page 2

Faculty of Applied Sciences

VNC connection through SSH tunnel

Under Display Name: you can type anything, Listen Port: 5900 and Destination Port: 5929 Destination Port = Listen Port + port number that server assigned in figure 2, in my case 29. In your case it will be different. Click OK

Figure 5

Click OK

Figure 6

Sinisa Milosavljevic

Page 3

Faculty of Applied Sciences Now click on Save Settings

VNC connection through SSH tunnel

Figure 7

Start your VNC Viewer application and for the server type localhost:0

Figure 8

Sinisa Milosavljevic

Page 4

Faculty of Applied Sciences

VNC connection through SSH tunnel

Type password that youve used when you ran vncserver for the first time, on from figure 1

Figure 9

And you have your session going

Figure 10

Sinisa Milosavljevic

Page 5

Faculty of Applied Sciences

VNC connection through SSH tunnel

How to exit VNC session


Close VNC windows by clicking on the X in the upper right corner. In the Terminal Window where you ssh to the remote Unix server, type: vncserver kill :29

Figure 11

In your case please substitute 29 with the number that you were getting in figure 2 This will end vnc session and finally exit ssh.

Sinisa Milosavljevic

Page 6

Potrebbero piacerti anche