Using the XDM Graphical Login Manager


You've already seen (in Chapter 5) how to use the graphical login managers built into the KDE and GNOME systems, KDM and GDM. These login systems provide a nice, seamless, graphical experience from startup to shutdown of your system, making sure users logging in on the local console can enter their KDE or GNOME sessions securely, without having access to the command-line shell. KDM and GNOME can even be configured to launch users' X11 sessions under other user environments or window managers than KDE or GNOME. However, these methods might not produce the desired effect, if you want to ensure that all users of the system have the ability to completely control their X11 sessions, including their .xinitrc startup scripts, using window managers other than KDE or GNOME.

XDM is the traditional graphical login manager for the X11 system, independent of any window manager or environment the user might choose. When it is run at system startup, it displays a graphical login prompt rather than the text-based login prompt at the console. The graphical login prompt is similar to a Windows 2000/XP login screen, and operates the same as KDM or GDM, but with a lot less flash and polish. It's also customizable with your own bitmaps if you want to get creative.

If you want to use XDM in your X11 sessions, you should edit a file called .xsession in your home directory. This file is the XDM equivalent of the .xinitrc file that the console login uses. It should contain the command to start your desired window manager, as well as the commands to start any applications you want to run automatically at boot time. All the commands in the .xsession file should end with an ampersand (&) so they start in the background. The following is what a sample .xsession file could look like:

exec wmaker xterm &


This would start the Window Maker window manager and also start an xterm automatically after login.

Note that unlike the .xinitrc file, the .xsession file needs to be executable; otherwise, it will not work. Other than that, the two files can be the same; you can save yourself some aggravation by simply making .xsession a symbolic link to .xinitrc, and then setting .xinitrc executable:

# ln -s .xinitrc .xsession # chmod +x .xinitrc


You can run XDM manually by typing xdm at the command line instead of startx; but this isn't an especially good idea for two reasons:

  1. It doesn't really get you any additional convenience; you end up having to log in twice, once at the command line and again in XDM.

  2. If you're worried about console security, it doesn't help at all, as anyone can come up to the machine and press Ctrl+Alt+Backspace to kill XDMand then they'll be dropped to your logged-in root shell.

A better solution is to have XDM launch automatically at boot time, the same way that KDM or GDM does (as you saw in Chapter 5). Setting up XDM is very similar to setting up KDM: you need to edit the /etc/ttys file, and enable the already present ttyv8 line to invoke XDM automatically.

ttyv5   "/usr/libexec/getty Pc"         cons25  on  secure ttyv6   "/usr/libexec/getty Pc"         cons25  on  secure ttyv7   "/usr/libexec/getty Pc"         cons25  on  secure ttyv8   "/usr/X11R6/bin/xdm -nodaemon"  xterm   on  secure ttyv9   "/usr/local/bin/kdm -nodaemon"  xterm   off secure # Serial terminals


Be sure that the fifth field is set to on. At the same time, if you'd previously configured KDM (as in this example), disable it by setting its fifth field to off.

Save the file and reboot the system. XDM should start automatically on the next system boot. If killed, it will just launch itself again, preventing users from being dropped to your root shell.

XDM is very configurable, and details of its configuration are beyond the scope of this book. See the man page for information on the various configuration files available to configure XDM.




FreeBSD 6 Unleashed
FreeBSD 6 Unleashed
ISBN: 0672328755
EAN: 2147483647
Year: 2006
Pages: 355
Authors: Brian Tiemann

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net