############################################################################ # Secure VNC # # mostly abridged from: # http://www.ep.ph.bham.ac.uk/general/support/vncsetup.html # # steps listed in order of event # # VERSION: 2019.04.18.0001 # ############################################################################ ############################################################################ # On the VNC "server" ############################################################################ # # We assume that TigerVNC (or simlar) is installed on your desktop system. # We assume that your dekstop is windows (if not, translate for you OS type). # #============================================================================ # On your server - Linux system (assume CentOS/RHEL). #============================================================================ # # Install pkgs (some are optional, but this all works). # yum -y install xorg-x11-server-Xvfb.x86_64 xorg-x11-fonts-Type1 \ tigervnc.x86_64 tigervnc-icons.noarch tigervnc-license.noarch tigervnc-server.x86_64 tigervnc-server-module.x86_64 yum -y groupinstall "GNOME Desktop" "Server with GUI" "System Administration Tools" "System Management" # Extras (ones I want/like) yum -y install \ meld kompare diffuse tkdiff ansible tree redhat-lsb-core bind-utils \ VirtualBox mlnx-ofa_kernel-4.3-OFED \ gnome-backgrounds.noarch \ f22-backgrounds-mate.noarch f22-backgrounds-gnome.noarch \ kdeartwork-wallpapers.noarch kde-wallpapers.noarch \ # # This is necessary only once, but can be changed whenever necessary # mbaker# vncpasswd # # I'm using session number 50 # mbaker# vncserver :50 # # You can pick the resolution you like, can be modifed later too. # mbaker#sudo vi /etc/sysconfig/vncservers VNCSERVERS="50:mbaker" VNCSERVERARGS[50]="-geometry 1680x1050 -localhost" #^^^^^^^^^ pick what your client supports ############################################################################ # On your dekstop (Windows) ############################################################################ # # You must have TigerVNC (or similar, VNC works as well) installed # #use either port forwarding in a cygwin or a putty session #5900 - is the well known port #5950 - 50 is the example session number, change as appropriate #setup the ssh tunnel for VNC to go through ssh -L 5900:localhost:5950 mbaker@mylinux #^^^^ change accordingly # ssh -L 5900:localhost:5950 mbaker@mygateway #^^^^ change accordingly # # "Option 1: directly connect to VNC" (THIS IS NOT USING THE TUNNEL) # $X - your viewer number, 50 in the above example vncviewer mylinux:$X # "Option 2: securely connect VIA THE TUNNEL over SSH" # $X - your viewer number, 50 in the above example #running VNC from a unix system vncviewer -via $USERNAME@mylinux localhost:$X #running VNC from a windows system /cygdrive/c/"Program Files"/TigerVNC/vncviewer.exe localhost #use the correct server-hostname and session number in the box # In the desktop, pre "F8" for menu (config menu) # To be able to cut-n-paste between windows and VNC # You must have "vncconfig" running on the VNC session, # and check the the 3 checkboxes. # # After that, you can: # # ~/.vnc/xstartup # nohup vncconfig -iconic & # # IF you cannot cut-n-paste after starting vncconfig, then close out # your viewer and start up the viewing again, should work now. # # OPTIONAL: RESIZE display size/resolution # # On the VNC Server node: xrandr xrandr -s ####x#### # Some examples xrandr -s 1680x1050 xrandr -s 1280x800 xrandr -s 1440x900 # Then, on the client vncviewer # Then setup screen options #============================================================================== # OLD STUFF #============================================================================== vncserver vncclient SERVER: ~/.vnc/xstartup #!/bin/sh xrdb $HOME/.Xresources xsetroot -solid grey xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" & /usr/dt/bin/dtsession & #twm & Download: http://www.realvnc.com/products/download.html On the unix server: vncserver :X where X is your desktop number (say 10 in this case: vncserver :10) default is "1" On the client: run the vncclient, put in the unix-server-name:# i.e. wbxdimg01:10 To get more windows, in the first window that was up (not required, but is better this way a master window that holds all the background jobs): do a xterm &. If it doesnt come up (the xterm), then do a export DISPLAY=localhost:10, then try the xterm & again, should work. To expand/shrink a window: select the top right window corner right MB, then drag. To decrease, you must first increase and then decrease as one action bug. To kill a hung window on the desktop of VNC, right click, get a menu, select kill, place the skull and crossbones over the window to kill and left MB. You are in TWM. To get X-Windows menu: on the menu bar of the window try CONTROL-KEY AND- left/middle/right MB, in the text area of window, try the same you will see many different menus. SHIFT and MBs will give other menus. ON the VNC menu bar, right click and you will get an options menu. #====================================================================================