Solved

Tunneling X via SSH

Posted on 2001-06-14
12
838 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
 
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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

914 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now