# Can't get XDMCP to work ?

## jon

hi,

I am trying to get xdm working with xdmcp. (only xdm, i use fluxbox)

I have read lots of stuff on internet and on this forum, but it still don't work. please help me...

I commented the line into the xdm-config :

```

#/etc/X11/xdm/xdm-config

! DisplayManager.requestPort:    0

```

and uncommented in Xaccess : 

```

#/etc/X11/xdm/Xaccess

*                     #any host can get a login window

* CHOOSER BROADCAST   #any indirect host can get a chooser

```

I modified the Xresources to get a better login screen, but I dont think this should do anything wrong.

at xdm startup, it launches X (with the line in Xservers) and I get the good login screen. but when I try :  X :1 -query localhost 

I dont see the login screen, just the X mouse, and after a while console says XDM : too many retransmissions, like X can't find xdm.

I tried many things, but doesn't seem to work, I have an AIX, HP/UX and an other linux (redhat) where xdmcp is working, on the redhat box there is kdm. And i get the right login screen from my computer, so it is not X, but really a bad configuration of xdm (or a bug ??)

thanks,

jon

----------

## dermot

Try using nmap to make sure that your xdm server is actually listening:

```
su -c "nmap -sU xdm.server.address.here -p 177"
```

You should see something like this:

```
Starting nmap 3.20 ( www.insecure.org/nmap/ ) at 2003-04-18 12:17 IST

Interesting ports on localhost (127.0.0.1):

Port       State       Service

177/udp    open        xdmcp

 

Nmap run completed -- 1 IP address (1 host up) scanned in 1.057 seconds
```

If you don't get that (you might get a message saying that the port scanned is closed), then you might have to add a line to your Iptables ruleset to allow incoming XDMCP connections (assuming that you are using iptables and haven't already added this rule):

```
iptables -I INPUT 1 -p udp --dport 177 -j ACCEPT
```

This'll allow anyone to connect on that port, so considering hardening that rule to only allow specific hosts or hosts on your local network. For example, add either of the following to the above command:

```
-s 192.168.75.25/32      # Will _ONLY_ accept connections from the machine with the IP address 192.168.75.25

-s 192.168.75.0/24       # Will allow connections from any machine with 192.168.75.x as it's IP address
```

There are probably other reasons that XDMCP isn't working for you, but this is what usually trips me up.

----------

## jon

I already used nmap, and i am sure that port 177 is open:

```

Starting nmap 3.20 ( www.insecure.org/nmap/ ) at 2003-04-18 14:13 CEST

Interesting ports on localhost (127.0.0.1):

(The 1466 ports scanned but not shown below are in state: closed)

Port       State       Service

68/udp     open        dhcpclient

137/udp    open        netbios-ns

138/udp    open        netbios-dgm

177/udp    open        xdmcp

Nmap run completed -- 1 IP address (1 host up) scanned in 4.883 seconds

```

I even try a netstat -anp|grep xdm i get this :

```

Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name   

tcp        0      0 0.0.0.0:1374            0.0.0.0:*               LISTEN      23830/xdm           

udp      272      0 0.0.0.0:177             0.0.0.0:*                           23830/xdm

```

the second field is the Recv-Q, so it receive information, but don't send anything, looks like xdm don't respond.

I don't use any firewalling options in my kernel (not compiled in)

I really don't know why it doesn't work for me, is there any other options to configure in other files ?

jon

----------

## dermot

Hmmm... At this point I'm stumped! I use GDM, unfortunately, so I'm not entirely sure about XDM itself. Sorry I couldn't be more help.  :Rolling Eyes: 

----------

## jon

thanks anyway

I keep an eye on this thread, so if someone have an idea, please help !

jon

----------

## jon

some more informations.

After I launched a new X session with X :1 -query localhost I still dont get the login screen, but I see that xdm takes 99% of cpu time and I have a  [su <defunct>] in the process list. If i kill X the defunc still here until i kill xdm (it doesn't stop with /etc/init.d/xdm stop)

It really looks like a bug, hmm ?

I have XFree 4.3.0 (no ebuild release), i'll try to upgrade to the r2 ebuild.

how can you see xdm version ?

jon

----------

## kael

I'm having the exact same problem with a recent install.

By chance are you running PPC?

AH!   :Smile:   Found the problem!

DNS lookup is very picky, try adding 

 *Quote:*   

> 
> 
> DisplayManager.removeDomainname:        false
> 
> 

 

to /etc/X11/xdm/xdm-config

----------

## jon

Sorry no, I have a linux on x86, so if you experience the same problem on another system it might be a bug, does xdm take all the cpu while you're trying to get the login screen ?

----------

## kael

An addition problem is the default DisplayManager.willing in  /etc/X11/xdm/xdm-config:

 *Quote:*   

> 
> 
> DisplayManager.willing:               su nobody -c /etc/X11/xdm/Xwilling
> 
> 

 

User nobody has a shell of /bin/false, this command fails to run (not sure why).

I tried both commenting out the entry as well as getting rid of the "su nobody -c", both did the trick.

----------

## jmarshall

Ah, I was just typing a response about how I was having the same problem as Jon. Went to preview and saw Kael's bit about "DisplayManager.willing:" command. Commented that out, and it now works for me. Sounds like it may be something for bugs.gentoo.org

----------

## kael

This is actually already covered in bug #10486; the summary doesn't draw the eye when querying for "remote x". I'm surprised at least the temporary work around wasn't put into place, to my eye the current Xwilling is root safe.

*shrug*

----------

