NiklasH wrote:wbsoft wrote:Code: Select all
nX()
{
for i in `seq 0 9`
do
if [ ! -e "/tmp/.X${i}-lock" ] ; then
XFree86 ":$i" -query localhost &
break
fi
done
}
the last one, nX, starts a new X login on a new display. (You should add localhost to /etc/X11/xdm/Xaccess)
I can't get this to work...
The nX function starts a new X window, but I get no login prompt (gdm, in my case).
Am I doing something wrong? I tried to add just 'localhost' in Xaccess. Should I add something more? I also tried to add CHOOSER localhost, but that didn't work either.
Maybe I'm just stupid...

But I would really like this to work, so any help is very appreciated!
You need to do several things to get this to work.
First off, most display managers -
especially kdm and
gdm - are configured to ignore the
-query (technically, it's XDMCP Query). You need to modify your window manager configuration file.
Display manager configuration
For kdm, it is in
/usr/kde/3.1/share/config/kdm/kdmrc (the
3.1 will vary, of course, if you're running a release other than 3.1.x). In this file you will find:
Code: Select all
[Xdmcp]
# Whether KDM should listen to XDMCP requests. Default is true.
#Enable=false
# The UDP port KDM should listen on for XDMCP requests. Don't change the 177.
#Port=177
# File with the private keys of X-terminals. Required for XDM authentication.
# Default is ""
#KeyFile=/usr/kde/3.1/share/config/kdm/kdmkeys
# XDMCP access control file in the usual XDM-Xaccess format.
# Default is /usr/kde/3.1/share/config/kdm/Xaccess
# XXX i'm planning to absorb this file into kdmrc, but i'm not sure how to
# do this best.
Xaccess=/etc/X11/xdm/Xaccess
Make sure that the 'Enable=false' line is commented out, and the 'Xaccess=/etc/X11/xdm/Xaccess' is
not commented out.
For gdm, please check this next section; I don't have gdm installed. However, according to the online references I can find, its configuration files are in
/etc/gdm/Init/gdm.conf.
In this file, set it up as follows:
I can't see a configuration for Xaccess, so presumably it uses the standard one.
Xaccess configuration
For most purposes, you just need to add the following line to
/etc/X11/xdm/Xaccess:
That's it (one asterix). You can make it more restrictive - the comments in the file should be adequate.
The nX function should now work.
Note, by the way, that there is a hole in this script: the presence of the /tmp/.X
n-lock is not a 100% guarantee that there's a server running, as this file might be left around if the server crashes.
Important: Firewalling
Be sure to have UDP port 177 closed on your firewall (if it's a sensible firewall, you have to
explicitly open ports). The protocol used - XDMCP - is not that secure; in addition, if you use the Xaccess setup I've suggested your display manager will offer login windows to
any X display - including random unknown ones on the Internet, if they can get at ports 177 and 6000 on your machine.