Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've set up a kiosk using Ubuntu 12.04, and I'd like to have it autologin after a user logs out or if the screen locks, in case someone manages to get back to lightdm or tries to login to the non-kiosk account after a reboot. I've tried setting display-setup-script in lightdm.conf to run xautolock to trigger restarting lightdm, but that just causes Ubuntu startup in low graphics mode. So basically, if lightdm is active instead of a user being logged in, log in the kiosk user.

share|improve this question

create the script below in e.g. /etc/lightdm/restart and make it executable (chmod 755), then enter the path to the script in /etc/lightdm/lighdm.conf as session-cleanup-script value:


and here is the script:


service lightdm restart 

This will restart lightdm whenever someone logs out, restarting the auto-login process.

share|improve this answer

If you're not wedded to lightdm in particular, then consider installing nodm, which is specifically designed for this kind of kiosk operation. I've been using it on a couple of machines (a MythTV frontend and a Web browser) for many years without problems.

share|improve this answer

In my case, in /etc/lightdm/lightdm.conf:

session-cleanup-script=service lightdm restart
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.