Ubuntu Server: Need to Remote desktop

Owen Townend owen.townend at gmail.com
Thu Jul 10 22:51:22 UTC 2008

On 11/07/2008, Bud Roth <junk at taiotoshi.org> wrote:
> Rob:
>  On your server, you need to "sudo apt-get install openssh vnc4server".
>  On your Linux client, ssh and vncviewer are standard parts of Ubuntu
>  installs.
>  Openssh is a Telnet-like command line terminal program that has security
>  built-in.  It uses an encrypted session, unlike telnet, to send data
>  back and forth.  That should be your command-line way to visit your
>  server.
>  Vnc-server provides a secure, GUI desktop based on the X server
>  installed on your server (xubuntu) to remote clients that request a
>  connection.  It eats up much less bandwidth than running a remote X
>  session.
>  Read up on both of them.  After you install, post your issues and
>  someone will be able to solve them.
>  Good luck,
>  Bud Roth


Whilst this works well, there are also other options:

Open putty, load your server's profile or type in your usual options.
Go to Connection->SSH->Tunnels
Leave both of the top checkboxes unchecked.
Type in a Source port, e.g. 12345
Type in a Destination ip and port for your service (relative to your
server) e.g.
Set 'Local' and 'Auto'.
Connect to your server.

Now, open up your local firefox, opera, IE, etc and as the address use
'localhost:12345'. This will then be forwarded over ssh to your server
which should diligently pass it to port 441 at (localhost)
i.e. itself. Adjust for your own particular set of ports. The source
port can be any free port greater than 1024, the destination port
should match the server service you're after. My example here of '441'
is the https port for my smoothwall box.

The ssh command to do exactly this from a console is
ssh -L 12345: user at server

You can forward to any address accessible from the server you are connecting to.
It is also possible to use hostnames for the destination address which
are resolved by the server:

In my smoothwall example, as well as the local https port I usually
also include a forward for vnc to my desktop box such as:
Source -
Destination - mattimeo:5900

Note that it is possible to put an entire address into the source port
section and that the localhost address space is meaning
you can for example set up multiple port forwards on the same port
bound to separate addresses.
For example if you have several monitoring servers that you wish to
connect to you can use something like:
Source -
Destination -
Source -
Destination -

Install a Windows X server such as 'xming'.
Start xming, note it's display number (mouse over the tray icon, usually :0.0)
Open putty, load your server's profile or type in your usual details.
Go to Connection->SSH->X11
Tick 'Enable X11 Forwarding'
If your xming display is at the default :0.0 then you can leave the 'X
display location' empty. else type in the location.
Connect to your server.
Type 'firefox' to open firefox. (use 'firefox&' to open in the
background - i.e. leave you with a useable console)

If it's not already set you will also need to set this option in
'X11Forwarding yes'

Hope this helps,

More information about the ubuntu-users mailing list