[K12OSN] Remote Desktop immage while ssh

Les Mikesell les at futuresource.com
Sun Sep 16 19:01:51 UTC 2007

Peter Scheie wrote:
> Nils Breunese wrote:
>> John Lucas wrote:
>>> On Saturday 15 September 2007 23:44, ahodson wrote:
>>>> Hi Nils
>>>>  From my server I need to ssh into 6 other servers - I use
>>>> <ssh -l root 10.###.###.### -X>
>>>> to gain console access, and then run routines like
>>>> /usr/bin/system-config-users
>>>> to add new students to a server, etc. The question was directed at
>>>> finding out how to turn console into the remote desktop, so I can then
>>>> push a chosen desktop background to all users using the "Push new
>>>> icons..." desktop icon... Is this doable this way?
>>>> Thanks for helping
>>>> alan
>>>> -=o=-
>>> If I have decoded "how to turn console into the remote desktop" 
>>> correctly,
>>> then you would need NX/freenx and log onto the remote system as root 
>>> (where
>>> the "Push new icons..." are located). You could *try* something like 
>>> this
>>> (assuming KDE for the moment):
>>>     ssh -X -l root remotemachine '/usr/bin/startkde'
>>> But I don't think you would like the result. NX is more efficient, 
>>> you can
>>> suspend sessions etc. NX/freenx would be the right tool.
>> That, or VNC if bandwidth isn't much of an issue (VNC is less work to 
>> setup). No SSH needed, that's why I was confused. Of course you can 
>> also just add users from a regular SSH shell, but I take it you're not 
>> very comfortable using the command line? It is much faster than any 
>> remote desktop method. :o)
>> Nils Breunese.
> You can also tunnel VNC over SSH in a two step process.  Step 1, ssh to 
> the server like so:
> ssh -L 3700:localhost:5900 10.x.x.x
> Step 2: Start the vncviewer on your local system (not the server you're 
> ssh-ing to) and point it at localhost:3700.  The connection will get 
> redirected over the ssh session and you'll get the VNC login screen 
> which looks just like what the clients see.   This method gives you ssh 
> security so you can use it over the internet, but not the 'must be setup 
> beforehand' requirements of NX.  OTOH, the 10.x.x.x address you mention 
> suggests you may only be connecting over the LAN, not the internet, so 
> the security may not be that important.  If you are connecting over the 
> internet, I suggest taking John's advice and setup NX as the performance 
> is much better than VNC, especially if this is something you'll be doing 
> in an ongoing basis.  But VNC over SSH is great in a pinch.  (I think 
> it's at this point that Les points out that some version of VNC comes 
> with ssh tunneling built-in, but I can never remember which version, and 
> that version isn't always available; this method works with any version.)

There are lots of other possibilities, but freenx/NX is the best if you 
need to do it often.   But, yes, if you want to connect via vnc over 
ssh, some versions of vncviewer have the -via option to set up the ssh 
tunnel transparently for you.  "vncviewer -via ssh_host target_host" 
will establish the port-forwarding ssh connection - which will prompt 
for a password if you haven't set up ssh keys, and may or may not be the 
same machine as the vnc target.   If you already have at least one 
machine you can reach with ssh and targets running vnc servers you can 
use this method with no additional setup, and if your vncview doesn't 
have the -via option you can do it manually by setting  up the port 
forwarding ssh connection as a separate step.

It is possible to start a normal X desktop through an ssh connection but 
I've forgotten the right command.  You can get almost the same effect by 
dragging the icons for the programs you'd want to run from the menus 
onto the desktop, then running nautilus from your remote ssh connection. 
Any programs you start by double-clicking the icons will open in new 
windows on your remote desktop.

   Les Mikesell
    lesmikesell at gmail.com

More information about the K12OSN mailing list