§2023-09-18

4.1. Configuration Files

$ ls /etc/X11/xdm
Xaccess  Xresources  Xservers  xdm-conf

Defines the names and 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, i.e. 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 (i.e. non-XDM managed X sessions).

!
!
!
!
!
DisplayManager.authDir:	/var/lib/xdm
DisplayManager.errorLogFile:	/var/log/xdm.log
DisplayManager.pidFile:		/var/run/xdm.pid
DisplayManager.keyFile:		/etc/X11/xdm/xdm-keys
DisplayManager.servers:		/etc/X11/xdm/Xservers
DisplayManager.accessFile:	/etc/X11/xdm/Xaccess
DisplayManager*resources:	/etc/X11/xdm/Xresources
DisplayManager.willing:		su nobody -s /bin/sh -c /usr/lib64/X11/xdm/Xwilling
! All displays should use authorization, but we cannot be sure
! X terminals may not be configured that way, so they will require
! individual resource settings.
DisplayManager*authorize:	true
DisplayManager*authName:	MIT-MAGIC-COOKIE-1
!
DisplayManager*chooser:		/usr/lib64/X11/xdm/chooser
DisplayManager*startup:		/usr/lib64/X11/xdm/Xstartup
DisplayManager*session:		/usr/lib64/X11/xdm/Xsession
DisplayManager*reset:		/usr/lib64/X11/xdm/Xreset
DisplayManager*authComplain:	true
! The following three resources set up display :0 as the console.
DisplayManager._0.setup:	/usr/lib64/X11/xdm/Xsetup_0
DisplayManager._0.startup:	/usr/lib64/X11/xdm/GiveConsole
DisplayManager._0.reset:	/usr/lib64/X11/xdm/TakeConsole
! SECURITY: do not listen for XDMCP or Chooser requests
! Comment out this line if you want to manage X terminals with xdm
DisplayManager.requestPort:	0

$ cat /etc/X11/xdm/Xaccess 
#
# Access control file for XDMCP connections
#
# To control Direct and Broadcast access:
#
#	pattern
#
# To control Indirect queries:
#
# 	pattern		list of hostnames and/or macros ...
#
# To use the chooser:
#
#	pattern		CHOOSER BROADCAST
#
# or
#
#	pattern		CHOOSER list of hostnames and/or macros ...
#
# To define macros:
#
#       %name		list of hosts ...
#
# To control which addresses xdm listens for requests on:
#
#	LISTEN		address [list of multicast groups ... ]
#
# The first form tells xdm which displays to respond to itself.
# The second form tells xdm to forward indirect queries from hosts matching
# the specified pattern to the indicated list of hosts.
# The third form tells xdm to handle indirect queries using the chooser;
# the chooser is directed to send its own queries out via the broadcast
# address and display the results on the terminal.
# The fourth form is similar to the third, except instead of using the
# broadcast address, it sends DirectQuerys to each of the hosts in the list
# The fifth form tells xdm which addresses to listen for incoming connections
# on.  If present, xdm will only listen for connections on the specified
# interfaces and/or multicast groups.
#
# In all cases, xdm uses the first entry which matches the terminal;
# for IndirectQuery messages only entries with right hand sides can
# match, for Direct and Broadcast Query messages, only entries without
# right hand sides can match.
#

#*					#any host can get a login window

#
# To hardwire a specific terminal to a specific host, you can
# leave the terminal sending indirect queries to this host, and
# use an entry of the form:
#

#terminal-a	host-a


#
# The nicest way to run the chooser is to just ask it to broadcast
# requests to the network - that way new hosts show up automatically.
# Sometimes, however, the chooser can't figure out how to broadcast,
# so this may not work in all environments.
#

#*		CHOOSER BROADCAST	#any indirect host can get a chooser

#
# If you'd prefer to configure the set of hosts each terminal sees,
# then just uncomment these lines (and comment the CHOOSER line above)
# and edit the %hostlist line as appropriate
#

#%hostlist	host-a host-b

#*		CHOOSER %hostlist	#

#
# If you have a machine with multiple network interfaces or IP addresses
# you can control which interfaces accept XDMCP packets by listing a LISTEN
# line for each interface you want to listen on.  You can additionally list
# one or more multicast groups after each address to listen on those groups
# on that address.
#
# If no LISTEN is specified, the default is the same as "LISTEN *" - listen on
# all unicast interfaces, but not for multicast packets.  If any LISTEN lines
# are specified, then only the listed interfaces will be listened on.
#
# IANA has assigned FF0X:0:0:0:0:0:0:12B as the permanently assigned
# multicast addresses for XDMCP, where X in the prefix may be replaced
# by any valid scope identifier, such as 1 for Node-Local, 2 for Link-Local,
# 5 for Site-Local, and so on.  The default is equivalent to the example shown
# here using the Link-Local version to most closely match the old IPv4 subnet
# broadcast behavior.
#
# LISTEN		* ff02:0:0:0:0:0:0:12b

# This example shows listening for multicast on all scopes up to site-local
#
# LISTEN	* ff01:0:0:0:0:0:0:12b ff02:0:0:0:0:0:0:12b ff03:0:0:0:0:0:0:12b ff04:0:0:0:0:0:0:12b ff05:0:0:0:0:0:0:12b

Contains a list of machines that XDM will connect to, to provide a login prompt, automatically - i.e. 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.

$ cat /etc/X11/xdm/Xservers 
#
# Xservers file, workstation prototype
#
# This file should contain an entry to start the server on the
# local display; if you have more than one display (not screen),
# you can add entries to the list (one per line).  If you also
# have some X terminals connected which do not support XDMCP,
# you can add them here as well.  Each X terminal line should
# look like:
#	XTerminalName:0 foreign
#
:0 local /usr/bin/X :0 vt7

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

Xcursor.theme: whiteglass

xlogin*login.translations: #override \
	Ctrl<Key>R: abort-display()\n\
	<Key>F1: set-session-argument(failsafe) finish-field()\n\
	<Key>Delete: delete-character()\n\
	<Key>Left: move-backward-character()\n\
	<Key>Right: move-forward-character()\n\
	<Key>Home: move-to-begining()\n\
	<Key>End: move-to-end()\n\
	Ctrl<Key>KP_Enter: set-session-argument(failsafe) finish-field()\n\
	<Key>KP_Enter: set-session-argument() finish-field()\n\
	Ctrl<Key>Return: set-session-argument(failsafe) finish-field()\n\
	<Key>Return: set-session-argument() finish-field()

xlogin*greeting: Welcome to CLIENTHOST
xlogin*namePrompt: \040\040\040\040\040\040\040Login:
xlogin*fail: Login incorrect or forbidden by policy

#if WIDTH > 800
xlogin*greetFont: -adobe-helvetica-bold-o-normal--24-240-75-75-p-138-iso8859-1
xlogin*font: -adobe-helvetica-medium-r-normal--18-180-75-75-p-98-iso8859-1
xlogin*promptFont: -adobe-helvetica-bold-r-normal--18-180-75-75-p-103-iso8859-1
xlogin*failFont: -adobe-helvetica-bold-r-normal--18-180-75-75-p-103-iso8859-1
xlogin*greetFace:	Serif-24:bold:italic
xlogin*face: 		Helvetica-18
xlogin*promptFace: 	Helvetica-18:bold
xlogin*failFace: 	Helvetica-18:bold
#else
xlogin*greetFont: -adobe-helvetica-bold-o-normal--17-120-100-100-p-92-iso8859-1
xlogin*font: -adobe-helvetica-medium-r-normal--12-120-75-75-p-67-iso8859-1
xlogin*promptFont: -adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1
xlogin*failFont: -adobe-helvetica-bold-o-normal--14-140-75-75-p-82-iso8859-1
xlogin*greetFace:	Serif-18:bold:italic
xlogin*face:		Helvetica-12
xlogin*promptFace:	Helvetica-12:bold
xlogin*failFace:	Helvetica-14:bold
#endif

#ifdef COLOR
xlogin*borderWidth: 1
xlogin*frameWidth: 5
xlogin*innerFramesWidth: 2
xlogin*shdColor: grey30
xlogin*hiColor: grey90
xlogin*background: grey
xlogin*inpColor: grey80
!xlogin*foreground: darkgreen
xlogin*greetColor: Blue3
xlogin*failColor: red
*Foreground: black
*Background: #fffff0
#else
xlogin*borderWidth: 3
xlogin*frameWidth: 0
xlogin*innerFramesWidth: 1
xlogin*shdColor: black
xlogin*hiColor: black
#endif

XConsole.text.geometry:	480x130
XConsole.verbose:	true
XConsole*iconic:	true
XConsole*font:		fixed

Chooser*geometry:		700x500+300+200
Chooser*allowShellResize:	false
Chooser*viewport.forceBars:	true
Chooser*label.font:		*-new century schoolbook-bold-i-normal-*-240-*
Chooser*label.label:		XDMCP Host Menu from CLIENTHOST
Chooser*list.font:		-*-*-medium-r-normal-*-*-230-*-*-c-*-iso8859-1
Chooser*Command.font:		*-new century schoolbook-bold-r-normal-*-180-*

[Unit]
Description=X-Window Display Manager
After=systemd-user-sessions.service

[Service]
ExecStart=/usr/bin/xdm -nodaemon
Type=notify
NotifyAccess=all

[Install]
Alias=display-manager.service