LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-07-2008, 03:02 PM   #1
essdeeay
Member
 
Registered: Aug 2004
Location: United Kingdom
Distribution: Debian
Posts: 88

Rep: Reputation: 15
Can't get XDMCP to work through SSH tunnel


Basically, I can connect using RDP, from A-->C (using a port forward in ssh).

However, I can't connect from A-->D using XDMCP (ideally I'd like the connection between B/D secure aswell). Is there a way to achieve this?

See here for Network topology diagram:
Network topology diagram

Many thanks,
Steve

Last edited by essdeeay; 06-07-2008 at 03:04 PM. Reason: Cou;dn't insert picture
 
Old 06-07-2008, 04:02 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Not sure what you mean "using XDMCP". That puts a new desktop on your desktop. I don't really do that (I prefer to open specific X applications on my XP desktop rather than have to deal with a sub-desktop.).

What you can do is open the tunnel from XP to A using PuTTY X11 tunneling. (Once you get the following working you can play with doing the full XDMCP setup if you really want that desktop on top of your XP desktop.)

Once logged into A it will set your DISPLAY variable there. (Assuming you haven't overwritten it with a value from /etc/profile, /etc/bashrc, $HOME/.profile, $HOME/.bashrc etc...). You can verify it works by typing "xterm" for a quick test. This should send an xterm X window back to your XP box. (Of course you already know you need to be running an X window emulator like Exceed or Xming on XP for this to work.)

Once you're sure that is working you can type "ssh -X D" (substituting name or IP of host D for D of course). This extends the tunnel to host D. You should be able to open xterm there and have it display back on your original PC.

Note that ssh tunnels require that you don't do su (switch user) after being established - the Xauthority is set only for the initial login user on each host. I've seen many who open the tunnel then do su to root and are confused why it doesn't work. There IS a way to make that work but I'll leave that out unless you ask for it later.

Last edited by MensaWater; 06-07-2008 at 04:04 PM.
 
Old 06-07-2008, 08:01 PM   #3
essdeeay
Member
 
Registered: Aug 2004
Location: United Kingdom
Distribution: Debian
Posts: 88

Original Poster
Rep: Reputation: 15
Thanks for the reply jlightner, it makes a lot of sense. However, I don't have X installed on B (Gateway server) though, which I suppose is the reason why $DISPLAY isn't set?

Incidentally, after ssh'ing to D, $DISPLAY isn't set there either.

Thanks,
Steve
 
Old 06-07-2008, 08:23 PM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Are these two hosts on the LAN? Can you log in via xdmcp without using the tunnel. You may have non-tunneling issues to deal with first.

If you use "ssh -X" you can run an individual program. The target host doesn't need X11 to be running. It could be using init level 3. The graphical program running on the target machine will still show up on your computer. There is an additional advantage that you can run different programs on different machines and have them show up on your remote X11 server. If you run a GUI program logged into a server, typically it is a config program such as system-config-* or YaST2. Having two instances from two servers can help you compare and use the first as a model.

I believe that for xdmcp you will need to have the target running in init level 5. KDM or GDM will handle the remote logging and traffic. For example, look in the kdmrc file if you use kdm. ( At least in older versions ) there is a configuration option whether to support xdmcp.

Code:
[Xdmcp]
# Whether KDM should listen to incoming XDMCP requests.
# Default is false
#Enable=false
# The UDP port on which KDM should listen for XDMCP requests. Do not change.
# Default is 177
#Port=177
I've found that often after a security upgrade the kdmrc file is replaced and the new version doesn't have a [Xdmcp] section at all. Also, note that udp port 177 is used. Does an ssh tunnel encapsulate udp ports?

IMHO, Xdmcp is used behind a secured firewall when ssh tunneling is too slow. Otherwise Xdmcp has too many security issues, and tunneling the traffic will loose the speed advantage anyway.

Last edited by jschiwal; 06-07-2008 at 08:26 PM.
 
Old 06-08-2008, 06:57 AM   #5
essdeeay
Member
 
Registered: Aug 2004
Location: United Kingdom
Distribution: Debian
Posts: 88

Original Poster
Rep: Reputation: 15
Thanks for your reply jschiwal...

Quote:
Originally Posted by jschiwal View Post
Are these two hosts on the LAN? Can you log in via xdmcp without using the tunnel. You may have non-tunneling issues to deal with first.
C (Windows XP running Xming) and D are on the same LAN, so if I create an SSH connection fron C using PuTTY (with X11 forwarding ticked), I get a whole desktop of D. So I'm happy D is configured correctly.]

I think the problem is how to extend the SSH tunnel from B-->D.

I can create a tunnel from A-->B and include port forwarding, something like "L 50022:D:22", then create another connection st7raight from A-->D but it's dog dog dog slow... I mean it takes 1 second to accept each keypress.

Thanks,
Steve

Last edited by essdeeay; 06-08-2008 at 06:59 AM. Reason: didn't quote properly
 
Old 06-10-2008, 05:14 AM   #6
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Xdmcp doesn't use port 22. Also port 22 is used for ssh itself so forwarding port for xdmcp may cause problems.
 
Old 06-10-2008, 08:19 AM   #7
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
The point in a tunnel is that the traffic doesn't know it is going over the tunnel. The DISPLAY is set to something like localhost:10.0 and it opens the X to that - the tunnel then sends it across port 22 unbeknownst to the originating X app that thinks it is using port in the 6000 range. XDMCP shouldn't care about port 22 any more than other X apps.

In lsof of an xterm from my Linux workstation to my XP desktop I see:
xterm 28881 jlightner 3u IPv4 73036527 TCP atljcl02.water.com:43777->atljcl02.water.com:x11-ssh-offset (ESTABLISHED)

Notice the xterm thinks it is connecting FROM the Linux workstation (atljcl02) TO the same Linux workstation. (x11-ssh-offset is port 6010).

The actual connection to the XP deskstop was opened by my original sshd connection:
sshd 28745 jlightner 3u IPv6 73027119 TCP 10.0.12.69:ssh->nbjlightner.dsw.net:1140 (ESTABLISHED)
(nbjlightner being the XP desktop and 10.0.12.69 being atljcl02 - notice ssh [port 22] is the port being used for the Linux workstation.)

Also since the above sshd was opened with a tunnel lsof displays:
sshd 28745 jlightner 8u IPv6 73027198 TCP [::1]:x11-ssh-offset (LISTEN)

It is the above LISTENing port that becomes ESTABLISHED once you open the X window.
 
Old 06-10-2008, 09:01 AM   #8
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
This article may help.
http://people.w3.org/~dom/archives/2...sion-with-gdm/

It has a comment that XDMCP can't be done over ssh tunnel due to its use of UDP ports which apparently the tunnel can't handle.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ftp over ssh tunnel; ftp refuses to work jakykong Linux - Networking 16 10-16-2011 07:34 AM
ssh tunnel wont work over the internet dannyk1 Linux - Networking 7 05-21-2008 03:22 AM
SSH tunnel doesn't work on local install, works on livecd depper Linux - Networking 3 10-17-2007 03:06 AM
setting up an ssh soxy or local ssh tunnel from within an ssh soxy Mangenius Linux - Networking 0 03-05-2007 03:15 PM
SSH tunnel help ZST Linux - Networking 2 07-05-2006 01:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration