Intro
This page is basically 'notes to self' and unlikely to interest many.

12-May-2014 - Even a blind hen eventually finds SSHFS
Sometimes you are just blind as a bat. I'd had a light need to modify remote files and used Samba (SMB) or NFS. I didn't like either and both are a disaster security wise. Then during the week-end I was thinking "SSH should have a nice solution...?". A bit of googlery et viola! SSHFS (Secure SHell File System), the answer to my prayers. Dead easy to install:

sudo apt-get install ssh
sudo apt-get install openssh-server
sudo apt-get install sshfs

You should have the first two already, but mentioned just in case. See Ref. [1] for more details. I'd like a GUI as I'll use this rarely. I like to keep things simple, so the Gigolo front-end appealed to me. Make sure to get the most recent version (0.4.2 currently). Major stable distros have ver. 0.4.1 that I had some minor issues with. Ubuntu 12.04LTS and Debian 7.x has 0.4.1, Ubuntu 14.04 LTS has ver. 0.4.2. If your distro doesn't have ver. 0.4.2 it is easy to compile it for yourself. Get the source from Ref. [2]. You need a bit of supporting packages and libs:

sudo apt-get install gtk+-2.0
sudo apt-get install intltool

Otherwise it is the usual procedure:

./configure
make
sudo make install

Setting up Gigolo
gigolo&
and here is a sample setup:

References.
[1] http://howto.blbosti.com/2010/09/mount-a-remote-ssh-folder-in-ubuntu-cmd-and-gui/
[2] http://www.uvena.de/gigolo/download.html

6-May-2014 - Free Multiuser Debian GUI Terminal Server Using Only VNCviewer over SSH as Client

Update 28-Sep-2015. Still working with Debian 8.2, except i had to substitute Gnome with MATE. No big loss...

Goal: Create a Debian terminal server accessible from any platform capable of running VNCviewer and SSH. To lock up the server behind a safe SSH tunnel connection (important these post-Snowden days!) and having only port 22 open in the router. Having no separate VNC passwords, and only Debian system passwords.
LTS screenshot
Note two simultaneous VNC users on the same server. And two is no way the limit.

This project is nothing like LTSP. It is way simpler and generic.

Status: Debian 7.5 running successfully over VNCviewer accessible from Linux and MS Windows. Probably also Apple OS, but not tested. Anything capable running a VNCviewer should be fine, including smartphones if you can live with the resolution.

Steps:
  1. Get multiple instances of VNC server running simultaneously.
  2. Configuring multiple VNC setup regarding resolution, color depth etc.
  3. Setting up XDMCP
  4. Client side SSH tunnel and VNCviewer setup.
Solutions:

  1. Get multiple instances of VNC server running simultaneously.
  2. Reference for this section [1]. Multiple instances of VNC serveres requires the use of vncserver and xinetd, so get this installed: apt-get install vncserver apt-get install xinetd
    xinetd needs to made start automatically upon boot: update-rc.d xinetd enable
  3. Configuring a VNC setup regarding resolution, color depth etc.
  4. Make the file /etc/xinetd/vnc:
    service vnc0
    {
    disable = no
    socket_type = stream
    protocol = tcp
    wait = no
    user = nobody
    server = /usr/bin/Xvnc
    server_args = -inetd -once -query localhost -geometry 1024x768 -depth 16
    type = UNLISTED
    port = 5900
    }

    This will give you a VNC window on the client with a 1024x768 resolution and a 16 bit color depth.

    However, there is no reason to limit yourself to one setup. Go on like this:

    service vnc0
    {
    disable = no
    socket_type = stream
    protocol = tcp
    wait = no
    user = nobody
    server = /usr/bin/Xvnc
    server_args = -inetd -once -query localhost -geometry 1024x768 -depth 16
    type = UNLISTED
    port = 5900
    }

    service vnc1
    {
    disable = no
    socket_type = stream
    protocol = tcp
    wait = no
    user = nobody
    server = /usr/bin/Xvnc
    server_args = -inetd -once -query localhost -geometry 1280x1024 -depth 16
    type = UNLISTED
    port = 5901
    }

    service vnc2
    {
    disable = no
    socket_type = stream
    protocol = tcp
    wait = no
    user = nobody
    server = /usr/bin/Xvnc
    server_args = -inetd -once -query localhost -geometry 1280x900 -depth 16
    type = UNLISTED
    port = 5902
    }

    Now your VNC client can choose from a 1024x768, a 1280x1024 and a 1280x900 window resolution, all in 16 bit color. There is still no reason to stop here: define some 24 bit color windows if you like, just make sure the [i]service[/i] name and the [i]port[/i] number is unique.

    Later we'll look at how to select a given resolution from the client.

    Later we'll look at how to select a given resolution from the client.

  5. Setting up XDMCP
    We want to use XDMCP to get a display manager login and avoid separate VNC password for each user. Debian 7.5 comes default with GDM3 as display manager, but I couldn't make XDMCP work with GDM3. I switched to LightDM and it was smooth sailing:
    apt-get install lightdm Follow instructions to make LightDM default display manager.

    Edit /etc/lightdm/lightdm.conf and make:

  6. [XDMCPServer] enabled=true port=177
    Restart the DM or reboot.

  7. Client side SSH tunnel and VNCviewer setup.
  8. Okay, that was the server side. Next is setting up things on the client: SSH tunnels and VNCviewer script. This is divided into a Linux client side and a MS Windows client side. Sample files available for both here.

    Linux client:
    First the SSH tunnel. Make this file named sshtunnel.sh
    #!/bin/sh
    if [ $# = "0" ]
    then
    echo "Usage: $0 username servername"
    else
    # 1024x768@16 - vncviewer:1
    ssh -C -L 5901:localhost:5900 -N -f -l $1 $2
    #
    # 1280x1024@16 - vncviewer:2
    ssh -C -L 5902:localhost:5901 -N -f -l $1 $2
    #
    # 1280x900@16 - vncviewer:3
    ssh -C -L 5903:localhost:5902 -N -f -l $1 $2
    #
    # 1024x768@24 - vncviewer:11
    ssh -C -L 5911:localhost:5910 -N -f -l $1 $2
    #
    # 1280x1024@24 - vncviewer:12
    ssh -C -L 5912:localhost:5911 -N -f -l $1 $2
    #
    # 1280x900@24 - vncviewer:13
    ssh -C -L 5913:localhost:5912 -N -f -l $1 $2
    fi

    Chmod it +x (chmod +x sshtunnel.sh). There is one inconvenience here: if you have multiple tunnels as in this example you have to type in the server side password multiple times. However, this is readily fixed by making SSH keys as described in ref. 2. The sshtunnels script is executed by ./sshtunnel.sh username servername.


    The VNCviewer launch script can be called LTSc.sh (Linux Terminal Server client). #!/bin/sh
    if [ $# = "0" ]
    then
    echo "Usage: $0 portnumber"
    else
    vncviewer -encodings raw -compresslevel 9 localhost:$1
    fi
    Chmod it +x (chmod +x LTSc.sh). Run it as i.e. ./LTSc.sh 11, 11 being the display portnumber defined in sshtunnel.sh - 1024x768@24.

    Please notice I have chosen to run SSH with compression (-C) and VNCviewer with raw encoding. This may not be the best speed choice for you as it depends on the mixture of hardware power and bandwidth. It's the rigth choice for powerful computers and a weak internet connection, but if your situation is the opposite you might want to run without -C and stick to VNCviewer compression defaults.

    MS Windows client:
    First the SSH tunnel. Make this file named sshtunnel.bat (line two as one long line):
    @echo off
    putty username@servername -C -L 5901:localhost:5900 -L 5902:localhost:5901 -L 5903:localhost:5902 -L 5911:localhost:5910 -L 5912:localhost:5911 -L 5913:localhost:5912
    You need to download putty.exe from Ref. 3.

    VNCviewer config is done somewhat different in MS Windows. You start the GUI VNCviewer with the options you like, log in to the server, go to the task bar, right click and save the configuration file as a .vnc. Sample files available here. They are simple as sshtunnel.bat basically defines everything.

References:
[1] http://www.ibm.com/developerworks/linux/library/os-multiuserloginsvnc/index.html
[2] http://en.wikipedia.org/wiki/Ssh-keygen
[3] http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
[4] http://www.tightvnc.com/download/1.3.10/tightvnc-1.3.10_x86_viewer.zip