XDM(1)
XDM(1) โ the display manager that runs the whole vibe ๐
General Commands Manual ยท XDM(1) ยท yes bestie, we're reading a manual page together, it's giving study date energy ๐โจ
NAME ๐
xdm โ X Display Manager with support for XDMCP, host chooser
SYNOPSIS ๐ฆ
xdm [ -config configuration_file ] [ -nodaemon ] [ -debug debug_level ]
[ -error error_log_file ] [ -resources resource_file ] [ -server
server_entry ] [ -session session_program ]
okay so it's literally just xdm and then a pile of optional flags, she's low maintenance like that ๐
DESCRIPTION ๐ธ
So xdm manages a whole collection of X displays, and those displays can be chillin' on the local host or out there on remote servers, no cap. The design of xdm was guided by what X terminals actually needed, plus The Open Group standard XDMCP โ that's the X Display Manager Control Protocol, iykyk. Basically xdm does the same job that init, getty and login do on character terminals: it prompts for login name and password, authenticates the user, and runs a ``session.'' โจ
A session'' is defined by the lifetime of a particular process. In the traditional character-based terminal world, that's the user's login shell. In the `xdm` context though, it's an arbitrary session manager. Why? Because in a windowing environment, a user's login shell process doesn't necessarily have any terminal-like interface to connect to. And when a real session manager isn't available, a window manager or terminal emulator is typically used as the session manager,'' which means termination of that process terminates the user's session. periodt. ๐
When the session is terminated, xdm resets the X server and (optionally) restarts the whole process. ๐
When xdm receives an Indirect query via XDMCP, it can run a chooser process to perform an XDMCP BroadcastQuery (or an XDMCP Query to specified hosts) on behalf of the display, and offer a menu of possible hosts that offer XDMCP display management. This feature is useful with X terminals that don't offer a host menu themselves. iconic behavior honestly ๐ง
Xdm can be configured to ignore BroadcastQuery messages from selected hosts. That's useful when you don't want the host to show up in menus produced by chooser or by the X terminals themselves. ๐
Because xdm provides the first interface that users will see, it's designed to be simple to use and easy to customize to the needs of a particular site. Xdm has many options, most of which have reasonable defaults. So browse through the various sections of this manual, picking and choosing the things you want to change. And pay particular attention to the Session Program section โ that's the one that describes how to set up the style of session desired. ๐
OVERVIEW ๐
xdm is highly configurable, and most of its behavior can be controlled by resource files and shell scripts. The names of these files themselves are resources read from the file xdm-config or the file named by the -config option. ๐๏ธ
xdm offers display management two different ways:
- It can manage X servers running on the local machine and specified in
Xservers. - It can manage remote X servers (typically X terminals) using XDMCP (the XDM Control Protocol) as specified in the
Xaccessfile.
The resources of the X clients run by xdm outside the user's session โ including xdm's own login window โ can be affected by setting resources in the Xresources file. ๐
For X terminals that don't offer a menu of hosts to get display management from, xdm can collect willing hosts and run the chooser program to offer the user a menu. For X displays attached to a host, this step is typically not used, as the local host does the display management.
After resetting the X server, xdm runs the Xsetup script to assist in setting up the screen the user sees along with the xlogin widget. ๐ฅ๏ธโจ
The xlogin widget, which xdm presents, offers the familiar login and password prompts.
After the user logs in, xdm runs the Xstartup script as root. ๐ณ
Then xdm runs the Xsession script as the user. This system session file may do some additional startup and typically runs the .xsession script in the user's home directory. When the Xsession script exits, the session is over. ๐ซถ
At the end of the session, the Xreset script is run to clean up, the X server is reset, and the cycle starts over. โป๏ธ
The file /var/log/xdm.log will contain error messages from xdm and anything output to stderr by Xsetup, Xstartup, Xsession or Xreset. So when you're having trouble getting xdm working, check this file to see if xdm has any clues to the trouble. ๐
OPTIONS ๐
All of these options, except -config itself, specify values that can also be specified in the configuration file as resources. flexible queen
-configconfiguration_file โ Names the configuration file, which specifies resources to control the behavior ofxdm./etc/X11/xdm/xdm-configis the default. See the section Configuration File.-nodaemonโ Specifies ``false'' as the value for theDisplayManager.daemonModeresource. This suppresses the normal daemon behavior, which is forxdmto close all file descriptors, disassociate itself from the controlling terminal, and put itself in the background when it first starts up.-debugdebug_level โ Specifies the numeric value for theDisplayManager.debugLevelresource. A non-zero value causesxdmto print lots of debugging statements to the terminal; it also disables theDisplayManager.daemonModeresource, forcingxdmto run synchronously. To interpret these debugging messages, a copy of the source code forxdmis almost a necessity. No attempt has been made to rationalize or standardize the output. so true bestie, good luck ๐-errorerror_log_file โ Specifies the value for theDisplayManager.errorLogFileresource. This file contains errors fromxdmas well as anything written to stderr by the various scripts and programs run during the progress of the session.-resourcesresource_file โ Specifies the value for theDisplayManager*resourcesresource. This file is loaded usingxrdb(1)to specify configuration parameters for the authentication widget.-serverserver_entry โ Specifies the value for theDisplayManager.serversresource. See the section Local Server Specification for a description of this resource.-udpPortport_number โ Specifies the value for theDisplayManager.requestPortresource. This sets the port-number whichxdmwill monitor for XDMCP requests. If set to0,xdmwill not listen for XDMCP or Chooser requests. As XDMCP uses the registered well-known UDP port177, this resource should not be changed to a value other than0, except for debugging. fr fr, don't touch it ๐ซ-sessionsession_program โ Specifies the value for theDisplayManager*sessionresource. This indicates the program to run as the session after the user has logged in.-xrmresource_specification โ Allows an arbitrary resource to be specified, as in most X Toolkit applications.
RESOURCES ๐ง
At many stages the actions of xdm can be controlled through the use of its configuration file, which is in the X resource format. Some resources modify the behavior of xdm on all displays, while others modify its behavior on a single display. Where actions relate to a specific display, the display name is inserted into the resource name between ``DisplayManager'' and the final resource name segment. ๐
For local displays, the resource name and class are as read from the Xservers file.
For remote displays, the resource name is what the network address of the display resolves to. See the removeDomain resource. The name must match exactly; xdm is not aware of all the network aliases that might reach a given display. If the name resolve fails, the address is used. The resource class is as sent by the display in the XDMCP Manage request.
Because the resource manager uses colons to separate the name of the resource from its value and dots to separate resource name parts, xdm substitutes underscores for both dots and colons when generating the resource name. For example, DisplayManager.expo_x_org_0.startup is the name of the resource which defines the startup shell file for the ``expo.x.org:0'' display. see how the dots and colons got swapped for underscores? ate ๐
DisplayManager.servers
This resource either specifies a file name full of server entries, one per line (if the value starts with a slash), or a single server entry. See the section Local Server Specification for the details.
DisplayManager.requestPort
This indicates the UDP port number which xdm uses to listen for incoming XDMCP requests. Unless you need to debug the system, leave this with its default value of 177.
DisplayManager.errorLogFile
Error output is normally directed at the system console. To redirect it, set this resource to a file name. A method to send these messages to syslog should be developed for systems which support it; however, the wide variety of interfaces precludes any system-independent implementation. This file also contains any output directed to stderr by the Xsetup, Xstartup, Xsession and Xreset files, so it will contain descriptions of problems in those scripts as well.
DisplayManager.debugLevel
If the integer value of this resource is greater than zero, reams of debugging information will be printed. It also disables daemon mode, which would redirect the information into the bit-bucket, and allows non-root users to run xdm, which would normally not be useful.
DisplayManager.daemonMode
Normally, xdm attempts to make itself into a daemon process unassociated with any terminal. This is accomplished by forking and leaving the parent process to exit, then closing file descriptors and releasing the controlling terminal. In some environments this is not desired (in particular, when debugging). Setting this resource to ``false'' will disable this feature.
DisplayManager.pidFile
The filename specified will be created to contain an ASCII representation of the process-id of the main xdm process. Xdm also uses file locking on this file to attempt to eliminate multiple daemons running on the same machine, which would cause quite a bit of havoc. two daemons, one machine = chaos, and not the cute kind ๐ญ
DisplayManager.lockPidFile
This is the resource which controls whether xdm uses file locking to keep multiple display managers from running amok. On System V, this uses the lockf library call, while on BSD it uses flock.
DisplayManager.authDir
This names a directory under which xdm stores authorization files while initializing the session. The default value is /var/lib/xdm. Can be overridden for specific displays by DisplayManager.DISPLAY.authFile.
DisplayManager.autoRescanโ okay bestie, this boolean is the "do you need a fresh look?" switch ๐ It controls whether xdm rescans the configuration, servers, access control and authentication keys files after a session terminates and the files have changed. Default?true, periodt. Also you can force xdm to reread these files whenever you want by sending aSIGHUPto the main process. Iconic.DisplayManager.removeDomainnameโ so when xdm computes the display name for XDMCP clients, the name resolver will typically create a fully qualified host name for the terminal. Which is, like, sometimes confusing ๐ So when this variable is set, xdm removes the domain name portion of the host name if it's the same as the domain name of the local host. Default value istrue.DisplayManager.keyFileโ XDM-AUTHENTICATION-1 style XDMCP authentication requires that a private key be shared between xdm and the terminal. This resource specifies the file containing those values. Each entry in the file consists of a display name and the shared key. > Heads up bestie: by default, xdm does not include support for XDM-AUTHENTICATION-1, because it requires DES which is not generally distributable due to United States export restrictions. Not my rules ๐DisplayManager.accessFileโ the security bouncer fr fr ๐ช To prevent unauthorized XDMCP service and to allow forwarding of XDMCP IndirectQuery requests, this file contains a database of hostnames which are either allowed direct access to this machine, or have a list of hosts to which queries should be forwarded to. The format of this file is described in the section XDMCP Access Control.DisplayManager.exportListโ a list of additional environment variables, separated by white space, to pass on to theXsetup,Xstartup,Xsession, andXresetprograms. Little care package of env vars ๐DisplayManager.randomDeviceโ a file to read 8 bytes from to generate the seed of authorization keys. The default is/dev/urandom. If this file cannot be read, or if a read blocks for more than 5 seconds, xdm falls back to using a checksum ofDisplayManager.randomFileto generate the seed. Backup plan behavior โจDisplayManager.greeterLibโ on systems that support a dynamically-loadable greeter library, the name of the library. The default is/usr/lib/X11/xdm/libXdmGreet.so.DisplayManager.choiceTimeoutโ number of seconds to wait for display to respond after user has selected a host from the chooser. If the display sends an XDMCP IndirectQuery within this time, the request is forwarded to the chosen host. Otherwise, it is assumed to be from a new session and the chooser is offered again. Default is15. The patience window โณDisplayManager.sourceAddressโ use the numeric IP address of the incoming connection on multihomed hosts instead of the host name. This is to avoid trying to connect on the wrong interface which might be down at this time. Avoiding the awkward wrong-door moment ๐ช๐ญDisplayManager.willingโ this specifies a program which is run (as) root when an an XDMCP BroadcastQuery is received and this host is configured to offer XDMCP display management. The output of this program may be displayed on a chooser window. If no program is specified, the stringWilling to manageis sent. Yes, the literal string, she said what she said ๐DisplayManager.DISPLAY.resourcesโ this resource specifies the name of the file to be loaded byxrdbas the resource database onto the root window of screen 0 of the display. TheXsetupprogram, theLoginwidget, and chooser will use the resources set in this file. This resource data base is loaded just before the authentication procedure is started, so it can control the appearance of the login window. See the section Authentication Widget, which describes the various resources that are appropriate to place in this file. There is no default value for this resource, but/etc/X11/xdm/Xresourcesis the conventional name. โจ the glow-up file โจDisplayManager.DISPLAY.chooserโ specifies the program run to offer a host menu for Indirect queries redirected to the special host nameCHOOSER./usr/lib/X11/xdm/chooseris the default. See the sections XDMCP Access Control and Chooser.DisplayManager.DISPLAY.xrdbโ specifies the program used to load the resources. By default, xdm uses/usr/bin/xrdb.DisplayManager.DISPLAY.cppโ this specifies the name of the C preprocessor which is used byxrdb.DisplayManager.DISPLAY.setupโ this specifies a program which is run (as root) before offering the Login window. This may be used to change the appearance of the screen around the Login window or to put up other windows (e.g., you may want to runxconsolehere). By default, no program is run. The conventional name for a file used here isXsetup. See the section Setup Program. The pre-game outfit change ๐DisplayManager.DISPLAY.startupโ this specifies a program which is run (as root) after the authentication process succeeds. By default, no program is run. The conventional name for a file used here isXstartup. See the section Startup Program.DisplayManager.DISPLAY.sessionโ this specifies the session to be executed (not running as root). By default,/usr/bin/xtermis run. The conventional name isXsession. See the section Session Program. The main character of the whole operation ๐DisplayManager.DISPLAY.resetโ this specifies a program which is run (as root) after the session terminates. By default, no program is run. The conventional name isXreset. See the section Reset Program. Cleanup era ๐งนDisplayManager.DISPLAY.openDelayDisplayManager.DISPLAY.openRepeatDisplayManager.DISPLAY.openTimeoutDisplayManager.DISPLAY.startAttemptsDisplayManager.DISPLAY.reservAttempts
These numeric resources control the behavior of xdm when attempting to open intransigent servers. openDelay is the length of the pause in seconds between successive attempts, openRepeat is the number of attempts to make, openTimeout is the amount of time to wait while actually attempting the open (i.e., the maximum time spent in the connect(2) system call) and startAttempts is the number of times this entire process is done before giving up on the server. After openRepeat attempts have been made, or if openTimeout seconds elapse in any particular attempt, xdm terminates and restarts the server, attempting to connect again. This process is repeated startAttempts times, at which point the display is declared dead and disabled. Although this behavior may seem arbitrary, it has been empirically developed and works quite well on most systems. The bound reservAttempts is the number of times a successful connect is allowed to be followed by a fatal error. When reached, the display is disabled. The default values are openDelay: 15, openRepeat: 5, openTimeout: 120, startAttempts: 4 and reservAttempts: 2.
Like, she's persistent but she's not gonna chase a server forever bestie ๐ the retry math is real.
DisplayManager.DISPLAY.pingIntervalDisplayManager.DISPLAY.pingTimeout
To discover when remote displays disappear, xdm occasionally pings them, using an X connection and XSync calls. pingInterval specifies the time (in minutes) between each ping attempt, pingTimeout specifies the maximum amount of time (in minutes) to wait for the terminal to respond to the request. If the terminal does not respond, the session is declared dead and terminated. By default, both are set to 5 minutes. If you frequently use X terminals which can become isolated from the managing host, you may wish to increase this value. The only worry is that sessions will continue to exist after the terminal has been accidentally disabled. xdm will not ping local displays. Although it would seem harmless, it is unpleasant when the workstation session is terminated as a result of the server hanging for NFS service and not responding to the ping. ๐ญ
DisplayManager.DISPLAY.terminateServerโ this boolean resource specifies whether the X server should be terminated when a session terminates (instead of resetting it). This option can be used when the server tends to grow without bound over time, in order to limit the amount of time the server is run. The default value isfalse.DisplayManager.DISPLAY.userPathโ xdm sets thePATHenvironment variable for the session to this value. It should be a colon separated list of directories; seesh(1)for a full description. The default value is/usr/local/bin:/usr/bin:/bin:/usr/games.DisplayManager.DISPLAY.systemPathโ xdm sets thePATHenvironment variable for the startup and reset scripts to the value of this resource. The default for this resource is/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin. Note the absence of.from this entry. This is a good practice to follow for root; it avoids many common Trojan Horse system penetration schemes. ๐ฅ no cap, keep that.out of root's PATH.DisplayManager.DISPLAY.systemShellโ xdm sets theSHELLenvironment variable for the startup and reset scripts to the value of this resource. It is/bin/shby default.DisplayManager.DISPLAY.failsafeClientโ if the default session fails to execute, xdm will fall back to this program. This program is executed with no arguments, but executes using the same environment variables as the session would have had (see the section Session Program). By default,/usr/bin/xtermis used. The emergency bestie ๐ซถDisplayManager.DISPLAY.grabServerDisplayManager.DISPLAY.grabTimeoutโ ok so security check โจ whilexdmis reading your login name and password it grabs the server and the keyboard, so nobody can snoop. ThegrabServerresource decides whether the server stays held the whole time the name/password is being read: when it'sfalse, the server gets ungrabbed right after the keyboard grab succeeds; otherwise it stays grabbed until juuust before the session begins. Default?false. ๐ NowgrabTimeoutis the max timexdmwill sit there waiting for the grab to actually succeed. The grab can fail if some other client already has the server grabbed, or if network latencies are literally so high. Default is 3 seconds โ and bestie, be cautious raising it, because a user can get spoofed by a look-alike window on the display. If the grab fails,xdmkills and restarts the server (if it can) and the session. ๐DisplayManager.DISPLAY.authorizeDisplayManager.DISPLAY.authNameโauthorizeis a boolean that controls whetherxdmgenerates and uses authorization for the local server connections. If authorization is used,authNameis a list of authorization mechanisms to use, separated by white space. XDMCP connections dynamically specify which authorization mechanisms are supported, soauthNamegets ignored in that case ๐. Whenauthorizeis set for a display and authorization isn't available, the user finds out by getting a different message displayed in the login widget. By defaultauthorizeistrue, andauthNameisMIT-MAGIC-COOKIE-1, or, ifXDM-AUTHORIZATION-1is available,XDM-AUTHORIZATION-1 MIT-MAGIC-COOKIE-1. ๐DisplayManager.DISPLAY.authFileโ this file is how authorization data travels fromxdmto the server, using the-authserver command line option. Keep it in a directory that is not world-writable, because otherwise it could easily be removed and that disables the authorization mechanism in the server ๐ญ. If you don't specify it, a name gets generated fromDisplayManager.authDirplus the name of the display.DisplayManager.DISPLAY.authComplainโ set it tofalseand it disables the use of theunsecureGreetingin the login window. See the section Authentication Widget. Default istrue. ๐ซถDisplayManager.DISPLAY.resetSignalโ the number of the signalxdmsends to reset the server. See the section Controlling the Server. Default is 1 (SIGHUP).DisplayManager.DISPLAY.termSignalโ the number of the signalxdmsends to terminate the server. See the section Controlling the Server. Default is 15 (SIGTERM).DisplayManager.DISPLAY.resetForAuthโ storytime ๐ the original implementation of authorization in the sample server reread the authorization file at server reset time, instead of when checking the initial connection. Sincexdmgenerates the authorization info just before connecting to the display, an old server wouldn't get up-to-date authorization info. This resource makesxdmsendSIGHUPto the server after setting up the file, which causes an extra server reset to happen, and during that reset the new authorization information gets read. Default isfalse, which works for all MIT servers. โจDisplayManager.DISPLAY.userAuthDirโ whenxdmcan't write to the usual user authorization file ($HOME/.Xauthority), it creates a unique file name in this directory and points the environment variableXAUTHORITYat the created file. Uses/tmpby default. ๐
๐ ๏ธ CONFIGURATION FILE ๐ ๏ธ
First things first bestie โ the xdm configuration file has to be set up. Make a directory (usually /etc/X11/xdm) to hold all the relevant files. ๐
Here's a reasonable configuration file, which could be named xdm-config:
DisplayManager.servers: /etc/X11/xdm/Xservers
DisplayManager.errorLogFile: /var/log/xdm.log
DisplayManager*resources: /etc/X11/xdm/Xresources
DisplayManager*startup: /etc/X11/xdm/Xstartup
DisplayManager*session: /etc/X11/xdm/Xsession
DisplayManager.pidFile: /var/run/xdm-pid
DisplayManager._0.authorize: true
DisplayManager*authorize: false
Notice how this file is mostly just references to other files ๐. Also notice that some of the resources are specified with * separating the components. Those ones can be made unique for each different display by replacing the * with the display-name โ but honestly, normally that is not very useful. See the Resources section for the complete discussion. ๐
๐ XDMCP ACCESS CONTROL ๐
The database file specified by the DisplayManager.accessFile provides the info xdm uses to control access from displays requesting XDMCP service. This file has three types of entries:
- entries that control the response to Direct and Broadcast queries
- entries that control the response to Indirect queries
- macro definitions
The format of the Direct entries is simple โ either a host name or a pattern. You can tell a pattern from a host name because it has one or more meta characters in it (* matches any sequence of 0 or more characters, and ? matches any single character), and those get compared against the host name of the display device. If the entry is a host name, all comparisons are done using network addresses, so any name that converts to the correct network address may be used. For patterns, only canonical host names are used in the comparison, so make sure you don't try to match aliases, okay? ๐
โโ๏ธ Putting a ! character in front of either a host name or a pattern causes hosts that match that entry to be excluded.
If you want to only respond to Direct queries for a host or pattern, you can follow it with the optional NOBROADCAST keyword. This is how you stop an xdm server from showing up on menus based on Broadcast queries. ๐ซ
An Indirect entry also contains a host name or pattern, but it follows it with a list of host names or macros that indirect queries should be sent to.
A macro definition contains a macro name and a list of host names and other macros that the macro expands to. To tell macros apart from hostnames, macro names start with a % character. Macros may be nested. ๐ช
Indirect entries may also specify that xdm should run chooser to offer a menu of hosts to connect to. See the section Chooser.
When checking access for a particular display host, each entry is scanned in turn and the first matching entry determines the response. Direct and Broadcast entries get ignored when scanning for an Indirect entry, and vice-versa. ๐
Blank lines are ignored, # is treated as a comment delimiter causing the rest of that line to be ignored, and \newline causes the newline to be ignored โ which is what lets indirect host lists span multiple lines. โจ
Here's an example Xaccess file:
#
# Xaccess - XDMCP access control file
#
#
# Direct/Broadcast query entries
#
!xtra.lcs.mit.edu # disallow direct/broadcast service for xtra
bambi.ogi.edu # allow access from this particular display
*.lcs.mit.edu # allow access from any display in LCS
*.deshaw.com NOBROADCAST # allow only direct access
*.gw.com # allow direct and broadcast
#
# Indirect query entries
#
%HOSTS expo.lcs.mit.edu xenon.lcs.mit.edu \
excess.lcs.mit.edu kanga.lcs.mit.edu
extract.lcs.mit.edu xenon.lcs.mit.edu #force extract to contact xenon
!xtra.lcs.mit.edu dummy #disallow indirect access
*.lcs.mit.edu %HOSTS #all others get to choose
If it's compiled with IPv6 support, multicast address groups may also be included in the list of addresses indirect queries are set to. Multicast addresses may be followed by an optional / character and hop count. If no hop count is specified, the multicast hop count defaults to 1, keeping the packet on the local network. For IPv4 multicasting, the hop count is used as the TTL. ๐
Examples:
rincewind.sample.net ff02::1 #IPv6 Multicast to ff02::1
#with a hop count of 1
ponder.sample.net CHOOSER 239.192.1.1/16 #Offer a menu of hosts
#who respond to IPv4 Multicast
# to 239.192.1.1 with a TTL of 16
๐ CHOOSER ๐
For X terminals that don't offer a host menu for use with Broadcast or Indirect queries, the chooser program can do it for them, no cap ๐
. In the Xaccess file, specify CHOOSER as the first entry in the Indirect host list. chooser will send a Query request to each of the remaining host names in the list and offer a menu of all the hosts that respond. Iconic behaviour honestly.
The list may consist of the word BROADCAST, in which case chooser will send a Broadcast instead, again offering a menu of all hosts that respond. Heads up though โ on some operating systems UDP packets can't be broadcast, so this feature will not work there. ๐ญ
Example Xaccess file using chooser:
extract.lcs.mit.edu CHOOSER %HOSTS #offer a menu of these hosts
xtra.lcs.mit.edu CHOOSER BROADCAST #offer a menu of all hosts
The program to use for chooser is specified by the DisplayManager.DISPLAY.chooser resource. If you want more flexibility at this step, the chooser could be a shell script ๐. chooser is the session manager here โ it gets run instead of a child xdm to manage the display.
Resources for this program can be put into the file named by DisplayManager.DISPLAY.resources.
When the user selects a host, chooser prints the host chosen, which gets read by the parent xdm, and then it exits. xdm closes its connection to the X server, and the server resets and sends another Indirect XDMCP request. xdm remembers the user's choice (for DisplayManager.choiceTimeout seconds) and forwards the request to the chosen host, which starts a session on that display. ๐ฆ
โจ LISTEN โจ
okay bestie, this next directive also lives in the Xaccess configuration file, and it's giving where should xdm actually listen? energy ๐
LISTEN interface [list of multicast group addresses]
interface may be a hostname or IP address representing a network interface on this machine, or the wildcard * to represent all available network interfaces. so versatile, we love that.
If one or more LISTEN lines are specified, xdm only listens for XDMCP connections on the specified interfaces. If multicast group addresses are listed on a listen line, xdm joins the multicast groups on the given interface. multicast join moment โจ
If no LISTEN lines are given, the original behavior of listening on all interfaces is preserved for backwards compatibility. Additionally, if no LISTEN is specified, xdm joins the default XDMCP IPv6 multicast group, when compiled with IPv6 support. backwards compat stays winning
To disable listening for XDMCP connections altogther, a line of LISTEN with no addresses may be specified, or the previously supported method of setting DisplayManager.requestPort to 0 may be used. choose your fighter ๐
Examples:
LISTEN * ff02::1 # Listen on all interfaces and to the
# ff02::1 IPv6 multicast group.
LISTEN 10.11.12.13 # Listen only on this interface, as long
# as no other listen directives appear in
# file.
๐ฆ IPv6 MULTICAST ADDRESS SPECIFICATION ๐ฆ
The Internet Assigned Numbers Authority has has assigned ff0X:0:0:0:0:0:0:12b as the permanently assigned range of multicast addresses for XDMCP. iconic range honestly The X in the prefix may be replaced by any valid scope identifier, such as 1 for Interface-Local, 2 for Link-Local, 5 for Site-Local, and so on. (See IETF RFC 4291 or its replacement for further details and scope definitions.) xdm defaults to listening on the Link-Local scope address ff02:0:0:0:0:0:0:12b to most closely match the old IPv4 subnet broadcast behavior.
๐ธ LOCAL SERVER SPECIFICATION ๐ธ
The resource DisplayManager.servers gives a server specification or, if the values starts with a slash (/), the name of a file containing server specifications, one per line. file mode activated
Each specification indicates a display which should constantly be managed and which is not using XDMCP. This method is used typically for local servers only. If the resource or the file named by the resource is empty, xdm will offer XDMCP service only.
Each specification consists of at least three parts: a display name, a display class, a display type, and (for local servers) a command line to start the server. A typical entry for local display number 0 would be:
:0 Digital-QV local /usr/bin/X :0
The display types are:
localโ local display: xdm must run the serverforeignโ remote display: xdm opens an X connection to a running server
The display name must be something that can be passed in the -display option to an X program. This string is used to generate the display-specific resource names, so be careful to match the names (e.g., use :0 Sun-CG3 local /usr/bin/X :0 instead of localhost:0 Sun-CG3 local /usr/bin/X :0 if your other resources are specified as DisplayManager._0.session). The display class portion is also used in the display-specific resources, as the class of the resource. This is useful if you have a large collection of similar displays (such as a corral of X terminals) and would like to set resources for groups of them. When using XDMCP, the display is required to specify the display class, so the manual for your particular X terminal should document the display class string for your device. If it doesn't, you can run xdm in debug mode and look at the resource strings which it generates for that device, which will include the class string. debug mode said "I got you bestie"
When xdm starts a session, it sets up authorization data for the server. For local servers, xdm passes -auth filename on the server's command line to point it at its authorization data. For XDMCP servers, xdm passes the authorization data to the server via the Accept XDMCP request. auth data stays secure, no cap
๐ RESOURCES FILE ๐
The Xresources file is loaded onto the display as a resource database using xrdb. As the authentication widget reads this database before starting up, it usually contains parameters for that widget:
xlogin*login.translations: #override\
Ctrl<Key>R: abort-display()\n\
<Key>F1: set-session-argument(failsafe) finish-field()\n\
<Key>Return: set-session-argument() finish-field()
xlogin*borderWidth: 3
xlogin*greeting: CLIENTHOST
#ifdef COLOR
xlogin*greetColor: CadetBlue
xlogin*failColor: red
#endif
Please note the translations entry; it specifies a few new translations for the widget which allow users to escape from the default session (and avoid troubles that may occur in it). Note that if #override is not specified, the default translations are removed and replaced by the new value, not a very useful result as some of the default translations are quite useful (such as <Key>: insert-char () which responds to normal typing). don't skip #override bestie, it's giving useful defaults
This file may also contain resources for the setup program and chooser.
๐ SETUP PROGRAM ๐
The Xsetup file is run after the server is reset, but before the Login window is offered. The file is typically a shell script. It is run as root, so should be careful about security. This is the place to change the root background or bring up other windows that should appear on the screen along with the Login widget. root power = root responsibility, fr fr
In addition to any specified by DisplayManager.exportList, the following environment variables are passed:
DISPLAY the associated display name
PATH the value of DisplayManager.DISPLAY.systemPath
SHELL the value of DisplayManager.DISPLAY.systemShell
XAUTHORITY may be set to an authority file
Note that since xdm grabs the keyboard, any other windows will not be able to receive keyboard input. They will be able to interact with the mouse, however; beware of potential security holes here. If DisplayManager.DISPLAY.grabServer is set, Xsetup will not be able to connect to the display at all. Resources for this program can be put into the file named by DisplayManager.DISPLAY.resources. security vibe check: protect the keyboard, bestie
Here is a sample Xsetup script:
#!/bin/sh
# Xsetup_0 - setup script for one workstation
xcmsdb < /etc/X11/xdm/monitors/alex.0
xconsole -geometry 480x130-0-0 -notify -verbose -exitOnFail &
โจ AUTHENTICATION WIDGET โจ
okay so this is the little login box bestie, the whole vibe of the greeter ๐
it's the thing that asks you for your username, your password, and/or whatever other auth data it needs, straight from the keyboard. and the way that nearly every imaginable parameter can be controlled with a resource? obsessed. you drop the resources for this widget into the file named by DisplayManager.DISPLAY.resources, and every single one of them has a reasonable default already, so fr fr you don't have to specify a single one if you don't want to. no cap.
That resource file gets loaded with xrdb(1), which means it can use all the substitutions that program defines โ like CLIENTHOST for the client hostname in the login message โ or C pre-processor #ifdef statements to produce different displays depending on color depth or other variables. iconic behavior honestly. โจ
Xdm can be compiled with support for the Xft(3) library for font rendering. If that support is present, you specify font faces with the resources whose names end in face, using the fontconfig face format described in the Font Names section of fonts.conf(5). If it's not present, then you specify fonts with the resources whose names end in font, in the traditional X Logical Font Description format described in the Font Names section of X(7). pick your fighter ๐
xlogin.Login.width,xlogin.Login.height,xlogin.Login.x,xlogin.Login.yโ the geometry of the Login widget is normally computed automatically. But if you want to position it somewhere else, specify each of these resources. you're the main character, you choose where you sit ๐xlogin.Login.foregroundโ the color used to display the input typed by the user.xlogin.Login.faceโ the face used to display the input typed by the user when built with Xft support. The default isSerif-18.xlogin.Login.fontโ the font used to display the input typed by the user when not built with Xft support.xlogin.Login.greetingโ a string which identifies this window. The default isX Window System.xlogin.Login.unsecureGreetingโ when X authorization is requested in the configuration file for this display and none is in use, this greeting replaces the standard greeting. The default isThis is an unsecure sessionxlogin.Login.greetFaceโ the face used to display the greeting when built with Xft support. The default isSerif-24:italic.xlogin.Login.greetFontโ the font used to display the greeting when not built with Xft support.xlogin.Login.greetColorโ the color used to display the greeting.xlogin.Login.namePromptโ the string displayed to prompt for a user name. Heads up bestie: Xrdb strips trailing white space from resource values, so to add spaces at the end of the prompt (usually a nice thing to do), add spaces escaped with backslashes. The default isLogin:xlogin.Login.passwdPromptโ the string displayed to prompt for a password, when not using an authentication system such as PAM that provides its own prompts. The default isPassword:xlogin.Login.promptFaceโ the face used to display prompts when built with Xft support. The default isSerif-18:bold.xlogin.Login.promptFontโ the font used to display prompts when not built with Xft support.xlogin.Login.promptColorโ the color used to display prompts.xlogin.Login.changePasswdMessageโ a message which is displayed when the users password has expired. The default isPassword Change Requiredxlogin.Login.failโ a message which is displayed when the authentication fails, when not using an authentication system such as PAM that provides its own prompts. The default isLogin incorrectxlogin.Login.failFaceโ the face used to display the failure message when built with Xft support. The default isSerif-18:bold.xlogin.Login.failFontโ the font used to display the failure message when not built with Xft support.xlogin.Login.failColorโ the color used to display the failure message.xlogin.Login.failTimeoutโ the number of seconds that the failure message is displayed. The default is10.xlogin.Login.logoFileNameโ name of an XPM format pixmap to display in the greeter window, if built with XPM support. The default is no pixmap. ๐ญxlogin.Login.logoPaddingโ number of pixels of space between the logo pixmap and other elements of the greeter window, if the pixmap is displayed. The default is5.xlogin.Login.useShapeโ if set totrue, when built with XPM support, attempt to use the X Non-Rectangular Window Shape Extension to set the window shape. The default istrue.xlogin.Login.hiColor,xlogin.Login.shdColorโ raised appearance bezels may be drawn around the greeter frame and text input boxes by setting these resources.hiColoris the highlight color, used on the top and left sides of the frame, and the bottom and right sides of text input areas.shdColoris the shadow color, used on the bottom and right sides of the frame, and the top and left sides of text input areas. The default for both is the foreground color, providing a flat appearance.xlogin.Login.frameWidthโframeWidthis the width in pixels of the area around the greeter frame drawn inhiColorandshdColor.xlogin.Login.innerFramesWidthโinnerFramesWidthis the width in pixels of the area around text input areas drawn inhiColorandshdColor.xlogin.Login.sepWidthโsepWidthis the width in pixels of the bezeled line between the greeting and input areas drawn inhiColorandshdColor.xlogin.Login.allowRootLoginโ if set tofalse, don't allow root (and any other user withuid = 0) to log in directly. The default istrue. This setting is only checked by some of the authentication backends at this time. ๐xlogin.Login.allowNullPasswdโ if set totrue, allow an otherwise failing password match to succeed if the account does not require a password at all. The default isfalse, so only users that have passwords assigned can log in.xlogin.Login.echoPasswdโ if set totrue, a placeholder character (echoPasswdChar) will be shown for fields normally set to not echo, such as password input. The default isfalse.xlogin.Login.echoPasswdCharโ character to display ifechoPasswdis true. The default is*. If set to an empty value, the cursor will advance for each character input, but no text will be drawn. sneaky but valid ๐ซถxlogin.Login.translationsโ this specifies the translations used for the login widget. Refer to the X Toolkit documentation for a complete discussion on translations. The default translation table is:
Ctrl<Key>H: delete-previous-character() \n\
Ctrl<Key>D: delete-character() \n\
Ctrl<Key>B: move-backward-character() \n\
Ctrl<Key>F: move-forward-character() \n\
Ctrl<Key>A: move-to-begining() \n\
Ctrl<Key>E: move-to-end() \n\
Ctrl<Key>K: erase-to-end-of-line() \n\
Ctrl<Key>U: erase-line() \n\
Ctrl<Key>X: erase-line() \n\
Ctrl<Key>C: restart-session() \n\
Ctrl<Key>\\: abort-session() \n\
<Key>BackSpace:delete-previous-character() \n\
<Key>Delete: delete-previous-character() \n\
<Key>Return: finish-field() \n\
<Key>: insert-char() \
๐ฆ The Actions ๐ฆ
these are the actions which are supported by the widget, and honestly the way each one does exactly one thing? it's giving clean design, periodt.
delete-previous-characterโ erases the character before the cursor.delete-characterโ erases the character after the cursor.move-backward-characterโ moves the cursor backward.move-forward-characterโ moves the cursor forward.move-to-beginingโ (Apologies about the spelling error.) Moves the cursor to the beginning of the editable text. the typo is canon bestie, we keep it ๐move-to-endโ moves the cursor to the end of the editable text.erase-to-end-of-lineโ erases all text after the cursor.erase-lineโ erases the entire text.finish-fieldโ if the cursor is in the name field, proceeds to the password field; if the cursor is in the password field, checks the current name/password pair. If the name/password pair is valid, xdm starts the session. Otherwise the failure message is displayed and the user is prompted again.abort-sessionโ terminates and restarts the server.abort-displayโ terminates the server, disabling it. This action is not accessible in the default configuration. There are various reasons to stop xdm on a system console, such as when shutting the system down, when usingxdmshell, to start another type of server, or to generally access the console. Sending xdm aSIGHUPwill restart the display. See the section Controlling XDM.restart-sessionโ resets the X server and starts a new session. This can be used when the resources have been changed and you want to test them or when the screen has been overwritten with system messages.insert-charโ inserts the character typed.set-session-argumentโ specifies a single word argument which is passed to the session at startup. See the section Session Program.allow-all-accessโ disables access control in the server. This can be used when the.Xauthorityfile cannot be created by xdm.
โ ๏ธ Be very careful using allow-all-access; it might be better to disconnect the machine from the network before doing this. like, actually fr fr, please. ๐
On some systems (OpenBSD) the user's shell must be listed in /etc/shells to allow login through xdm. The normal password and account expiration dates are enforced too. ๐ธ
๐ STARTUP PROGRAM ๐
okay so the Xstartup program is what gets run as root the moment the user logs in, bestie. it's usually a shell script. and because it runs as root, Xstartup has to be SO careful about security โ like, unhinged levels of careful. this is the place to put commands that add entries to utmp or wtmp files (the sessreg program may be useful here ๐ซถ), mount users' home directories from file servers, or straight-up abort the session if logins aren't allowed.
on top of whatever you specify with DisplayManager.exportList, these environment variables get passed:
DISPLAY the associated display name
HOME the initial working directory of the user
LOGNAME the user name
USER the user name
PATH the value of DisplayManager.DISPLAY.systemPath
SHELL the value of DisplayManager.DISPLAY.systemShell
XAUTHORITY may be set to an authority file
WINDOWPATH may be set to the "window path" leading to the X server
no arguments get passed to the script, periodt. Xdm waits until this script exits before starting the user session. and if the exit value of this script is non-zero? xdm discontinues the session and starts another authentication cycle. bye ๐
the sample Xstartup file shown here prevents login while the file /etc/nologin exists. so it's not a complete example โ it's simply a demonstration of the available functionality.
here's a sample Xstartup script:
#!/bin/sh
#
# Xstartup
#
# This program is run as root after the user is verified
#
if [ -f /etc/nologin ]; then
xmessage -file /etc/nologin -timeout 30 -center
exit 1
fi
sessreg -a -l $DISPLAY -x /etc/X11/xdm/Xservers $LOGNAME
/etc/X11/xdm/GiveConsole
exit 0
๐ SESSION PROGRAM ๐
the Xsession program is the command that gets run as the user's session. it runs with the permissions of the authorized user (not root, we love that for us ๐
).
in addition to whatever you specify with DisplayManager.exportList, these environment variables get passed:
DISPLAY the associated display name
HOME the initial working directory of the user
LOGNAME the user name
USER the user name
PATH the value of DisplayManager.DISPLAY.userPath
SHELL the user's default shell (from getpwnam)
XAUTHORITY may be set to a non-standard authority file
KRB5CCNAME may be set to a Kerberos credentials cache name
WINDOWPATH may be set to the "window path" leading to the X server
at most installations, Xsession should look in $HOME for a file .xsession, which contains commands that each user would like to use as a session. Xsession should also implement a system default session if no user-specified session exists. no cap โจ
an argument may be passed to this program from the authentication widget using the set-session-argument action. this can be used to select different styles of session. one good use of this feature is to let the user escape from the ordinary session when it fails โ which means users can repair their own .xsession if it fails, without requiring administrative intervention. iconic. the example following demonstrates this feature.
this example recognizes the special ``failsafe'' mode, specified in the translations in the Xresources file, to provide an escape from the ordinary session. it also requires that the .xsession file be executable so we don't have to guess what shell it wants to use.
#!/bin/sh
#
# Xsession
#
# This is the program that is run as the client
# for the display manager.
case $# in
1)
case $1 in
failsafe)
exec xterm -geometry 80x24-0-0
;;
esac
esac
startup=$HOME/.xsession
resources=$HOME/.Xresources
if [ -f "$startup" ]; then
exec "$startup"
else
if [ -f "$resources" ]; then
xrdb -load "$resources"
fi
twm &
xman -geometry +10-10 &
exec xterm -geometry 80x24+10+10 -ls
fi
the user's .xsession file might look something like this example. don't forget that the file must have execute permission ๐ซฃ
#! /bin/csh
# no -f in the previous line so .cshrc gets run to set $PATH
twm &
xrdb -merge "$HOME/.Xresources"
emacs -geometry +0+50 &
xbiff -geometry -430+5 &
xterm -geometry -0+50 -ls
๐งผ RESET PROGRAM ๐งผ
symmetrical with Xstartup, the Xreset script is run after the user session has terminated. run as root, it should contain commands that undo the effects of commands in Xstartup โ updating entries in utmp or wtmp files, or unmounting directories from file servers. the environment variables that were passed to Xstartup are also passed to Xreset. it's giving cleanup era ๐ธ
a sample Xreset script:
#!/bin/sh
#
# Xreset
#
# This program is run as root after the session ends
#
sessreg -d -l $DISPLAY -x /etc/X11/xdm/Xservers $LOGNAME
/etc/X11/xdm/TakeConsole
exit 0
๐น๏ธ CONTROLLING THE SERVER ๐น๏ธ
Xdm controls local servers using POSIX signals. SIGHUP is expected to reset the server, closing all client connections and performing other cleanup duties. SIGTERM is expected to terminate the server. and if these signals do not perform the expected actions, the resources DisplayManager.DISPLAY.resetSignal and DisplayManager.DISPLAY.termSignal can specify alternate signals. slay, options โจ
to control remote terminals not using XDMCP, xdm searches the window hierarchy on the display and uses the protocol request KillClient in an attempt to clean up the terminal for the next session. heads up: this may not actually kill all of the clients, since only those which have created windows will be noticed ๐ญ. XDMCP provides a more sure mechanism โ when xdm closes its initial connection, the session is over and the terminal is required to close all other connections. periodt.
๐ก CONTROLLING XDM ๐ก
Xdm responds to two signals: SIGHUP and SIGTERM.
when sent a SIGHUP, xdm rereads the configuration file, the access control file, and the servers file. for the servers file, it notices if entries have been added or removed. if a new entry has been added, xdm starts a session on the associated display. entries which have been removed are disabled immediately โ meaning that any session in progress will be terminated without notice and no new session will be started. yeah. no notice. brutal but true ๐
when sent a SIGTERM, xdm terminates all sessions in progress and exits. this can be used when shutting down the system.
Xdm attempts to mark its various sub-processes for ps(1) by editing the command line argument list in place. because xdm can't allocate additional space for this task, it is useful to start xdm with a reasonably long command line (using the full path name should be enough). each process which is servicing a display is marked -display.
๐ฅ๏ธ ADDITIONAL LOCAL DISPLAYS ๐ฅ๏ธ
to add an additional local display, just add a line for it to the Xservers file. (see the section Local Server Specification.)
examine the display-specific resources in xdm-config (e.g., DisplayManager._0.authorize) and consider which of them should be copied for the new display. the default xdm-config has all the appropriate lines for displays :0 and :1. easy โจ
๐ OTHER POSSIBILITIES ๐
you can use xdm to run a single session at a time, using the 4.3 init options or other suitable daemon by specifying the server on the command line:
xdm -server โ:0 SUN-3/60CG4 local /usr/bin/X :0โ
or, you might have a file server and a collection of X terminals. the configuration for this is identical to the sample above, except the Xservers file would look like
extol:0 VISUAL-19 foreign
exalt:0 NCD-19 foreign
explode:0 NCR-TOWERVIEW3000 foreign
this directs xdm to manage sessions on all three of these terminals. see the section Controlling Xdm for a description of using signals to enable and disable these terminals in a manner reminiscent of init(8). ๐ฆ
๐ LIMITATIONS ๐
one thing that xdm isn't very good at doing is coexisting with other window systems. to use multiple window systems on the same hardware, you'll probably be more interested in xinit. that's just the vibe, bestie ๐
โก ASYNCHRONOUS EVENTS โก
xdm uses SIGALRM and SIGUSR1 for its own inter-process communication purposes, managing the relationship between the parent xdm process and its children. sending these signals to any xdm process may result in unexpected behavior. don't do it. i'm serious ๐ซถ
SIGHUPโ causes xdm to rescan its configuration files and reopen its log file.SIGTERMโ causes xdm to terminate its children and shut down.SIGUSR2โ causes xdm to reopen its log file. this is useful if log rotation is desired, butSIGHUPis too disruptive.
๐ FILES ๐
/etc/X11/xdm/xdm-configโ the default configuration file$HOME/.Xauthorityโ user authorization file where xdm stores keys for clients to read/usr/lib/X11/xdm/chooserโ the default chooser/usr/bin/xrdbโ the default resource database loader/usr/bin/Xโ the default server/usr/bin/xtermโ the default session program and failsafe client/var/lib/xdm/A<display>-<suffix>โ the default place for authorization files/tmp/K5C<display>โ Kerberos credentials cache
๐ SEE ALSO ๐
X(7), xinit(1), xauth(1), xrdb(1), Xsecurity(7), sessreg(1), Xserver(1), xdmshell(1), fonts.conf(5), xdm.options(5).
X Display Manager Control Protocol
IETF RFC 4291: IP Version 6 Addressing Architecture.
๐ AUTHOR ๐
Keith Packard, MIT X Consortium
and that's the whole page, bestie!! this little masterpiece is from X Version 11, specifically xdm 1.1.11 โ give or take whatever date the footer is stamping on it, which honestly is just a formality when the content ate this hard ๐ go forth and manage your displays, you main character ๐โจ
๐ฆ where this page comes from
- debian trixie: xdm 1:1.1.11-6.1
- ubuntu noble: xdm 1:1.1.11-3ubuntu4
- ubuntu questing: xdm 1:1.1.11-6.1ubuntu1
- ubuntu resolute: xdm 1:1.1.11-6.1ubuntu2
- ubuntu stonking: xdm 1:1.1.11-6.1ubuntu2
- Copyright 1988, 1994, 1998 The Open Group
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms