[gdm-list] Fwd: Autologin and multiseat
- From: Darryl Bond <darryl bond gmail com>
- To: gdm-list gnome org
- Subject: [gdm-list] Fwd: Autologin and multiseat
- Date: Mon, 26 Nov 2012 09:34:59 +1000
Guy,
Thanks for the script. I have tuned it up a bit, you may be interested.
My use case is a kiosk that creates a user based on the $DISPLAY and removes them when they log off. The password is a one time generated password.
First I had to revert to the fallback login box so I could remove the userlist.
mv /usr/share/gnome-session/sessions/gdm-shell.session /root/
cp /usr/share/gnome-session/sessions/gdm-fallback.session /usr/share/gnome-session/sessions/gdm-shell.session
gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.mandatory --type bool --set "/apps/gdm/simple-greeter/disable_user_list" "true"
Then Copy /etc/gdm/Init/Default to :0
# cd /etc/gdm/Init
# cp Default :0
and add to the end of :0
/etc/gdm/Init/autologin.sh&
Link the number of displays required
ln :0 :1
ln :0 :2
...
Create the autologin.sh script
vi /etc/gdm/Init/autologin.sh
#!/bin/bash
PASS=$(openssl rand -base64 32)
PW=$(perl -e 'print crypt("$PASS", "aa")')
exec >/var/log/gdm/${DISPLAY}-autolog.log 2>&1
LUSER=kiosk$(echo $DISPLAY | cut -c 2-)
if [ -d /home/$LUSER ]
then
# delete the user and home directory
/usr/sbin/userdel -f -r $LUSER
fi
/usr/sbin/useradd -m -k /home/admin -p $PW $LUSER
sleep 1
xdotool type $LUSER
xdotool key Return
sleep 1
xdotool type $PASS
xdotool key Return
Make it executable
# chmod +x autologin.sh
Fix Selinux file labels
# cd /etc/gdm/Init
# chcon --reference=Default :0 autologin.sh
Test by logging out of display, it should log back in automagically.
Thanks
Darryl
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]