• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 853
  • Last Modified:

Tunneling X via SSH

I have 3 machines -- A, B & C.

All 3 machines sit on the same network, except that 'A' is connected over a relatively slow ISDN link.

B is a linux box on the fast network, and C is a Solaris box, from which I need to run X apps.  I want to route the traffic from C->A via B to take advantage of ssh compression. (encryption doesn't hurt either, although it is not my primary concern in this case)

i.e.:

<pre>
          s l o w           fast
     A &lt;-----&gt; B &lt;-----&gt; C
  X Server       SSH Tunnel      Application
</pre>

Ideally, I'd like to use direct XDMCP from 'A' to 'C' (I don't need to broadcast or do indirect query)

BTW, B does not run an X server, although Xvfb is available there if needed.  

Is all of this possible?  How do I go about implementing it?
0
IsleOfView
Asked:
IsleOfView
  • 4
  • 3
  • 2
  • +2
1 Solution
 
IsleOfViewAuthor Commented:
hrm....I guess diagrams don't work so well here, but hopefully, you can get the picture.  Let me know if you need any clarification of the setup.
0
 
superschlonzCommented:
As I read in the manual you should be able to do it this way:

Login with ssh to host B and then look at the DISPLAY variable:
> echo $DISPLAY
This shows something like ':1' or 'hostname:1'
login to host C and set the DISPAY variable using the name of host b and the nuber
which was set in the DISPLAY variable on host b:
> DISPLAY='hostb:1'
> export DISPLAY
(or with csh 'setenv DISPLAY hostb:1').
then start the application.
0
 
IsleOfViewAuthor Commented:
I've tried as you suggested.

DISPLAY on host B shows <host_b>:10.0

I telnet from B to C, and set the DISPLAY var the same as it is on B.  Trying to start a simple xterm on C results in this message:

X connection to <host_b>:10.0 broken (explicit kill or server shutdown).

I can't see anything in logs on either A or B that would suggest any kind of problem (in fact, nothing is written during the connection attempt).  I have even attempted executing 'xhost +' on both A and B, but that has made no difference.
0
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

 
superschlonzCommented:
Sorry, I can't test this here, I would have to reconfigure my firewall.
0
 
tbeardenCommented:
if you can connect directly to a from c and vice versa then go to the remote host and type

export $DISPLAY=host:0.0

on the local machine you will have to type

xhost +remotehost

However, if you have to telnet(or ssh) to b and then to c then you will have to use ssh port forwarding and this can get pretty complicated.
0
 
IsleOfViewAuthor Commented:
tbearden -- port forwarding is exactly what I'm asking for.  Specifically, I'm looking to take forward of ssh compression, as the link between a and the other hosts is rather slow.  It is impossible to install sshd on c, so I would like to use port forwarding through b to accomplish the task.
0
 
tbeardenCommented:
ok, I haven't had time to test this, but this is how I think it should work.  Ssh from hosta to hostb with:

ssh -R 6000:hosta:6000 hostb

Then telnet to host c and enter:

export $DISPLAY=hostb:0.0

on hosta type:

xhost +hostb

I think this should work.  You can then try running an xterm on hostc.  let us know what happens.
0
 
tbeardenCommented:
ok, I haven't had time to test this, but this is how I think it should work.  Ssh from hosta to hostb with:

ssh -R 6000:hosta:6000 hostb

Then telnet to host c and enter:

export $DISPLAY=hostb:0.0

on hosta type:

xhost +hostb

I think this should work.  You can then try running an xterm on hostc.  let us know what happens.
0
 
tbeardenCommented:
Upon more consideration I am not sure which xhost you need to add, so I would add both of them.

xhost +hostb
xhost +hostc
0
 
CleanupPingCommented:
IsleOfView:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
majorwooCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

Accept: tbearden {http:#6212628}

Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

majorwoo
EE Cleanup Volunteer
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 4
  • 3
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now