4. Configuring XDM

This section covers what needs to be configured for XDM to perform the functions described so far in this document.

In each case, the configuration described is the minimum necessary to accomplish each goal. In most cases this means that the configuration is also the least secure. Please refer to some of the additional documentation listed in Section 7 for additional information about securing XDM and X terminals (in particular the 'Running Remote X Applications Howto').

4.1. Configuration Files

This describes the following scheme of XDM configuration files :

This will be found in (Debian 2.1. Mandrake 7.0.2, RedHat 6.2) :
      /etc/X11/xdm
      
or (SuSE 6.4) :
      /usr/X11R6/lib/X11/xdm
      

xdm-config

Defines the locations of the other configuration files and the basic access permissions. For all distributions considered for this document, the file names were as listed here (but sometimes the locations varied).

This also defines the scripts to be run for the various state transitions for an X session, ie on startup, etc. You should not need to change these, as most distributions would appear to come with this pre-configured for you.

Note that XDM managed X sessions have a different set of startup and configuration scripts to X sessions started via xinit or startx (ie non-XDM managed X sessions).

Xaccess

Determines which machines can connect to XDM - ie from which other machines on the network we are accepting XDMCP queries. If a machine is not listed in this file, then it will not be able to request a login prompt from XDM.

Xservers

Contains a list of machines that XDM will connect to, to provide a login prompt, automatically - ie those machines already running an X server, but would like this machine to provide the login prompt.

This is only required for 'XDM Managed X Servers'. You do not need any entries in this file if you will be relying on remote X servers to query XDM.

When running as a stand-alone 'X Workstation', there is usually a single entry in this file, listing just the localhost.

Xresources

Details of the X properties used by the XDM widgets (eg size of the login 'box', colours, bitmap backgrounds, etc).

4.2. Configuring XDM to Manage X Servers

An entry must be placed in the Xservers file for each X server that XDM will be presenting a login prompt on. This could include the local machine and/or a list of remote machines.

Example
      # First the local host
      :0 local /usr/bin/X11/X vt7
      #
      # Then the remote hosts
      emma:0 foreign
      alex:0 foreign
      

This will start XDM on the local machine and also present a login screen on the X servers running on the hosts 'emma' and 'alex' (assuming that permissions have been setup on 'emma' and 'alex' such that this machine is permitted to connect to the running X servers).

Note that it is possible to specify the host and display (:0, :1, etc) if required, for example, if you are running multiple X servers on a single machine, etc.

4.3. Configuring XDM to Receive Queries

The file Xaccess determines which hosts may query XDM on this machine, in order to request a login prompt.

Example
      # First line for direct queries
      *
      # Following line for indirect queries
      * CHOOSER BROADCAST
      

This means that any host may request a login prompt via XDM (the first '*') using a direct query.

The 'CHOOSER' line specifies which hosts can connect to XDM using indirect queries - in this case, any host may query this machine for a list of potential hosts to connect to (the second '*' line).

'BROADCAST' means that the 'chooser' application on this machine will obtain its list of available servers (that will also be running XDM) via network broadcast queries. I will talk about the 'chooser' later.

It is possible to place specific host names in these entries (and there are also other indirect queries possible, without using the chooser) but this is not described here (refer to Section 7 for some links to more information).

4.4. Starting X

The way you start the X server itself, will depend upon how you want it to interact with XDM locally and remotely.

X Workstation : XDM and local X server

XDM will normally start X automatically for you and XDM will usually be configured to run as part of the startup process (via the init scripts).

The Xservers file would typically contain a single entry - that of the local host, and the Xaccess file would only need to permit access from the local host.

X Terminal : Remote XDM

Just start X with no clients, with access permissions such that the remote XDM is able to connect when it starts up. The following will start X with no access control :
          /usr/X11R6/bin/X -ac
          

When the remote XDM is started, it will 'push out' a login prompt to all such configured X servers (as listed in its Xservers file).

X Terminal : Query a remote XDM

Recall there are 3 modes for queries : direct, indirect and broadcast (direct for a single host, broadcast for the first host that replies or indirect for a list of hosts) :
          /usr/X11R6/bin/X -query the.remote.host
          /usr/X11R6/bin/X -broadcast
          /usr/X11R6/bin/X -indirect the.remote.host
          

In each case, X will probably have to be started as root, and could be configured to be started up via the init scripts, if X is required automatically on startup.

4.5. The Chooser Application

When XDM receives an indirect query, and assuming that the option has been specified in Xaccess for the 'chooser' application, it can provide the user with a list of other XDM managed servers that it knows about.

In this mode of operation, instead of the normal XDM login prompt, the user will be presented with a 'chooser' application, which will provide a list of detected hosts on the network that are currently accepting XDM connections.

When I first tried the use the chooser, I found that the Xresources files that came with my SuSE and Debian systems, specified a size for the chooser widget that was too big for the screens ... The following line from the Xresources file fixed that :
      Chooser*geometry:      700x500+300+200
      

The chooser will obtain its lists of hosts by one of two methods :