Remote X Logins Using kdm
By Tim Wunder, email@example.com
Last updated 6-Nov-01
Overview of creating a grapical login from one linux machine to another using XFree86 4.1.0 and kdm 2.2.1.
KDE 2.2.1, XFree86 4.1.0, kernel 2.4.9
AMD Athlon 950MHz 392MB RAM
KDE 2.2.1, XFree86 4.1.0, stock kernel
AMD K6-2-450, 128MB RAM
As with anything computer related, these steps are what worked for me, and to the best of my knowledge, they should work for everyone. However, not everone's system is configured the same way and you may need to configure something differently.
Verify which login manager you're using so you can edit the correct configureation files. I use kdm, replace kdm in these steps with your login manager (xdm, gdm, whatever).
Edit the Xaccess file to enable remote logins. My kdm Xaccess file is located in /etc/X11/kdm, that should be fairly standard. You can use 'locate Xaccess' if it's not there (assuming, of course, that your distro installed locate and it gets updated).
Here are the contents of mine:
# $XConsortium: Xaccess,v 1.5 91/08/26 11:52:51 rws Exp
# Access control file for XDMCP connections
# To control Direct and Broadcast access:
# To control Indirect queries:
# pattern list of hostnames and/or macros ...
# To use the chooser:
# pattern CHOOSER BROADCAST
# pattern CHOOSER list of hostnames and/or macros ...
# To define macros:
# %name list of hosts ...
# 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
# 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.
Note: This is the important part:
# Add network logins 10/16/01
* #any host can get a login window
In the standard file, there is a # at the beginning of this line. Remove it to enable remote X logins
# 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:
# 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
The CHOOSER stuff referenced in the file is for enabling a server chooser screen, as I understand it. I did not try anything fancy with this as I only have the one server and one workstation. This may be worth investigating if you have a larger network and want to be able to login to different servers.
Edit your xdm-config file to
contain the following:
My xdm-config file was located in /etc/X11/kdm, yours should be in the same directory as your Xaccess file. Additionally, if the file contains a reference to "DisplayManager.requestPort: 0", make sure that the line is commented out with a bang (!) at the beginning.
Create an X0.hosts file that'll list the hosts that are allowed access to your server on display 0, and place it in /etc. Enter the hosts as hostnames (resolvable from your /etc/hosts file), or as IP addresses, one host per line. I also created an X1.hosts file which is just a symlink to X0.hosts, which gives the hosts allowed to connect to your server on display 1. (I think).
If using kdm in KDE 2.2.1, edit the kdmrc file, mine was located in /opt/kde2/share/config/kdm, so that Remote logins are enabled. There is a section titled [Xdmcp] at the end of the file where you do this:
Restart your X server.
Logout of X
Ctrl-Alt-F1 to get to a console screen
login as root
telinit 3 (or /usr/sbin/init 3)
make sure X has shut down completely
telinit 5 (or /usr/sbin/init 5)
From a console login (not a
graphical login), execute the command
X :<display number> -query <server IP or hostname>
<display number> can be whatever display number you wish to connect on, I used 1. Your graphical login should now appear on your screen.
Caldera Users: http://www.caldera.com/support/foruns/users.html