Solved

Tunneling X via SSH

Posted on 2001-06-14
12
840 Views
Last Modified: 2010-03-18
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
Comment
Question by:IsleOfView
  • 4
  • 3
  • 2
  • +2
12 Comments
 

Author Comment

by:IsleOfView
ID: 6190784
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
 
LVL 3

Expert Comment

by:superschlonz
ID: 6196967
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
 

Author Comment

by:IsleOfView
ID: 6202358
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
Flexible connectivity for any environment

The KE6900 series can extend and deploy computers with high definition displays across multiple stations in a variety of applications that suit any environment. Expand computer use to stations across multiple rooms with dynamic access.

 
LVL 3

Expert Comment

by:superschlonz
ID: 6202843
Sorry, I can't test this here, I would have to reconfigure my firewall.
0
 
LVL 4

Expert Comment

by:tbearden
ID: 6208749
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
 

Author Comment

by:IsleOfView
ID: 6208924
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
 
LVL 4

Expert Comment

by:tbearden
ID: 6212445
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
 
LVL 4

Accepted Solution

by:
tbearden earned 200 total points
ID: 6212628
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
 
LVL 4

Expert Comment

by:tbearden
ID: 6214088
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
 

Expert Comment

by:CleanupPing
ID: 9078781
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
 
LVL 9

Expert Comment

by:majorwoo
ID: 9975974
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

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question