[wellylug] Running an X session over SSH

Sam Cannell sam at plaz.net.nz
Wed Jan 28 22:16:38 NZDT 2004


On Wed, Jan 28, 2004 at 10:07:02PM +1300, Jamie Dobbs wrote:
> I have an SSH server set up at work (running X as well) that I would
> like to be able to remotely connect to (from home) and run an X-session
> on. Can anyone tell me how I can do this easily?
> A quick Google hasn't turned up mush of any use.

You can't forward XDMCP over SSH because it uses UDP rather than TCP
when locating a willing server.

However you can forward individual X clients as follows:

* Ensure that X11 forwarding is allowed on the server:

Edit /etc/ssh/sshd_config

-/etc/ssh/sshd_config-
X11Forwarding yes
----------------------

* Ensure that your SSH client is set to forward X traffic:

Either edit ssh_config:

-/etc/ssh/ssh_config-
Host *
  ForwardX11 yes
---------------------

Or add the -X parameter to the ssh command line

* Bring up an X session locally, and open an xterm

* Ensure your DISPLAY environment variable is set

* SSH to your server.  If X forwarding is configured correctly, you
  should have a DISPLAY environment variable automagically set

* Inside the SSH session, start an X client like xcalc or xterm.  It
  should appear on your local desktop.


If you get an error message saying you've been denied access to the X
server, try running the following inside an xterm on the local machine:

xhost +localhost

Then attempt to start a remote X client again.

With a bit of fiddling, you may find you can start a local X session
with only an xterm running, ssh to the remote host and execute your
~/.xsession or ~/.xinitrc to run a full X session from the remote
server.

Hope this helps :)

Sam
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.wellylug.org.nz/pipermail/wellylug/attachments/20040128/6900cc60/attachment.pgp 


More information about the wellylug mailing list