VNC use SSH tunnel on Debian
- Install SSH server and VNC server:
apt-get install ssh vnc4server
- SSH server configuration
See My past post SSH login without password - VNC server configuration
cunzhang@node31:~$ cat .vnc/xstartup#!/bin/sh# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
x-terminal-emulator -geometry 80×24+10+10 -ls -title “$VNCDESKTOP Desktop” &
#x-window-manager &
xfce4-session&cunzhang@node31:~$ cat /etc/xinetd.d/xvncserver
service vnc-1024×768x24
{
protocal = tcp
socket_type = stream
wait = no
user = nobody
servr = /usr/bin/Xvnc
server_args = -inetd -query localhost -localhost -once -geometry 102×768 -depth 24
port = 5901
} - SSH client Installation and configuration
I use Windows and OpenSSH. Download OpenSSH and install the client.And download the pub key from the remote server. - VNC viewer Installation
I use TightVNC viewer.Install it with the default cofiguration. - Create a batch file to use SSH tunnel to connect the server.
ssh -l cunzhang 192.168.1.1 vnc4server :1 -localhost
ssh -l cunzhang 192.168.1.1 -L 5901:127.0.0.1:5901
ssh -l cunzhang 192.168.1.1 vnc4server -kill :1 - Run This batch file and open the TightVNC viewer, input 127.0.0.1:1,then input password.
Now You’r working in the remote desktop.
Reference:
Nice theme,I love it so much.
Comment by Ed — December 20, 2008 @ 23:24