A more complete How-To for setting up autologin of clients using Gnome & GDM
From K12LTSP Wiki
For younger elementary students and public 'kiosk' client machines, it may be desirable to have some client machines automatically login without user intervention. This can be setup with GDM, which is the default display manager in K12LTSP. This document covers K12LTSP versions 5, 6 and EL5, although the steps for each version are slightly different. The steps below describe how to setup a timed autologin for some client machines (or you can set them all this way if you like). With a timed autologin, the client machines won't automatically login until a defined number of seconds of inactivity at the login screen have elapsed. This allows these client machines to be also used by people who have their own login IDs. This same autologin behavior can also be accomplished with KDM, the KDE Display Manager, and is documented at http://ltsp.org/contrib/autologin_kdm.html. For more information on setting up autologin with GDM, see also the LTSP wiki at http://wiki.ltsp.org/twiki/bin/view/Ltsp/WorkInProgress#Public_and_private_use_of_the_wo .
Contents |
Steps for K12LTSP 5 only
First things first: Autologin is controlled by GDM, the Gnome Display Manager (note that this does not have any bearing on whether you run Gnome or KDE for your desktop). The GDM that is shipped with Fedora Core 5, on which K12LTSP version 5 is based, is broken, such that while autologin will work, you'll be embarrassed by the results: The login screen will say "/usr/bin/autologin| will login in X seconds", and when the timer reaches zero, those client machines that should autologin will, while those that should not will have their X server restarted, causing their screens to blink a time or two, and repeat the process until someone actually logs in. This restarting of the X server is annoying to watch. To fix this problem, you must download a patched GDM in RPM format that fixes the problem. To install the new GDM, use these steps (make sure no users are logged in on clients because they WILL be disconnected):
- On the server, make sure you are not logged in via the graphical login screen (in other words, you should be at the GUI login screen).
- Switch to a command-line console by pressing Ctrl-Alt-F1.
- Login as root.
- Shutdown GDM. Type
telinit 3
This will switch the system to runlevel 3, which is the non-GUI mode, and will shutdown GDM. You can verify this if you wish by pressing Ctrl-Alt-F7 where you should see just a blank screen instead of the GUI login screen. Press Ctrl-Alt-F1 to get back to the command prompt.
- Install the new GDM package. With the new GDM RPM file in the current directory, type
rpm -hUv gdm-2.14.9-2.i386.rpm
You'll see some hashmarks indicating the progress, and ultimately you'll end up back at the prompt. If there are no errors, the package was installed successfully.
- You can restart GDM and login at the GUI login screen at this time by running 'telinit 5' (press Ctrl-Alt-F7 if you don't automatically get transferred to the GUI login screen). After the steps below you will need to restart GDM, so you may not want to let users back into the system yet.
Steps for K12LTSP 6 only
The GDM that comes with K12LTSP 6 supports autologin out of the box. No special steps are needed. Skip to 'Setting up autologin' below.
Steps for K12LTSP-EL5 only
The GDM that ships with CentOS 5/K12LTSP-EL5 is broken; autologin works for those clients that have been configured for it, but it causes problems for those clients that you don't want to autologin. To fix it, follow either Method A or Method B. Method A is easier, faster, etc., but if you like to do these things for yourself, or if method A doesn't work for you, then use Method B.
Method A
- download this rebuilt GDM package
- Install it:
rpm -hUv gdm-2.16.5-2.i386.ps.rpm
- Restart GDM. Note that this will kick off ALL users including you even if you're logged in via the GUI at the console. To avoid problems, go to the server console, press Ctrl-Alt-F1, and you'll be switched to a command-line prompt; login as root and run this command:
gdm-restart
This will load the new GDM and the GUI will restart on the server and all the clients. You can now skip to 'Setting up autologin'.
Method B
Rebuild your own GDM from Fedora Core 6 on your K12LTSP-EL5 box and install that, using these steps:
- Download the source RPM file for GDM.
- Run the following command as root:
rpmbuild --rebuild gdm-2.16.5-2.src.rpm
- If you get a bunch of dependency errors, use yum to install all the missing packages, and then run the rpmbuild command again.
- A new GDM package will be built in /usr/src/redhat/RPMS/i386. Install this via the rpm command:
rpm -hUv /usr/src/redhat/RPMS/i386/gdm-2.16.5-2.i386.rpm
- Restart GDM. Note that this will kick off ALL users including you even if you're logged in via the GUI at the console. To avoid problems, go to the server console, press Ctrl-Alt-F1, and you'll be switched to a command-line prompt; login as root and run this command:
gdm-restart
This will load the new GDM and the GUI will restart on the server and all the clients. You can now skip to 'Setting up autologin'.
Setting up autologin
- For the clients that should autologin, you'll need to put their MAC addresses into /etc/dhcpd-k12ltsp.conf (or /etc/dhcpd.conf, depending on which version you have) and assign them to specific addresses:
host ws001 {- hardware ethernet 00:01:03:86:9f:cd;
- fixed-address 192.168.0.1;
- }
- Restart dhcpd after making the above changes:
service dhcpd restart
- Create a user ID for each client machine that will autologin. This how-to assumes the IDs are auto1, auto2, auto3, etc.
- Create the /usr/bin/autologin script. This script figures out which client it's running on and then passes a correpsonding login ID to GDM for the autologin. Here's a sample script, which you can modify to suit your needs:
#!/bin/bash
- CLIENT=$(echo $DISPLAY | cut -d. -f1)
- case "$CLIENT" in
- "ws001") disp=auto1;;
- "ws002") disp=auto2;;
- "ws003") disp=auto3;;
- esac
- echo $disp
- Be sure the $disp variable is being set to valid user IDs you created in the previous step. Remember to make the autologin script executable ('chmod +x /usr/bin/autologin').
- Modify /etc/gdm/custom.conf and add the following settings under the daemon and security sections. Be sure to include the pipe character at the end of the TimedLogin line.
- [daemon]
- AutomaticLoginEnable=true
- TimedLoginEnable=true
- TimedLogin=/usr/bin/autologin|
- TimedLoginDelay=30
- [security]
- AllowRemoteAutoLogin=true
- Restart GDM. This will kick all users, including you at the console, off the system and send them back to the login screen. As such, it's best if you switch to a command prompt console by pressing Ctrl-Alt-F1, and login in as root, if you aren't already. Then, restart gdm:
gdm-restart
All your client machines should have their login screen restarted, and on those you designated for autologin you should see a line saying that 'User autoX will login in Y seconds', afterwhich the client will login to Gnome. Client machines that you have not designated for autologin should just display the standard login screen with no mention of autologin or a timer.
