Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

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 been playing with Ubuntu Oneiric on my netbook (where breakage isn't really a concern); I like the new lightdm login screen, but it has one minor annoyance: in addition to my own user account, there's another account for occasional use by my girlfriend, and her user account is the one that's always focused (presumably because it's first alphabetically).

I know how to fix this in gdm but haven't found a solution for lightdm. Does anyone know how to set it up so my account is highlighted by default?

share|improve this question

Edit the file /etc/lightdm/lightdm.conf (gksu gedit /etc/lightdm/lightdm.conf) and add a line like this at it:

share|improve this answer
Thanks, but so far I've had no luck - has this worked for you? I've tried different variations, eg default-user=sean (my login name), default-user=1000 (my UID), etc but so far, no change. – Sean Fitzpatrick Aug 31 '11 at 21:20
I've read it somewhere, don't remember where. I'm not using lightdm yet. I will research more. – desgua Aug 31 '11 at 21:39
OK, this seems to work now - with the latest updates the correct user is selected by default. Not sure if this is due to me adding the default-user line, or if it now remembers the last login. (I guess I could try removing the default-user line and see what happens - but at least it works now!) – Sean Fitzpatrick Oct 1 '11 at 17:07
As a quick note to anyone who's reading this and using 12.04, this setting no longer has any effect and is not in the example conf file anymore. I believe that as of 12.04 the default will be the last logged-in user. – mfisch Oct 2 '12 at 3:26

The "default-user" option has been removed from lightdm. Why? Nobody knows. It's been five years since this question was originally asked and it's still broken. Lightdm now saves the state of who last logged in in a hidden file here:


So, here's a three step workaround:

  1. Create a shell script called /usr/local/bin/lightdm-default-user with the following contents:

    # LightDM removed the default-user option.
    # The only recourse now is an ugly kludge. 
    # Note that if you want to default to the "Guest Session",
    # you need to specify the last user as "*guest".
    /bin/echo -e '[greeter]\nlast-user=*guest' > /var/lib/lightdm/.cache/lightdm-gtk-greeter/state
  2. Make it executable: chmod 755 /usr/local/bin/lightdm-default-user

  3. Have lightdm automatically run the script upon start up by editing /etc/lightdm/lightdm.conf and adding a line in the [SeatDefaults] section:


This is horrifically ugly but it is, unfortunately, the best solution at the moment.

share|improve this answer

In /etc/lightdm/lightdm.conf

Go down the file until you get to:

# greeter-hide-users=false

Un-comment it, make sure the value is false.

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.