Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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

With gdm3, I was able to remove the last connected users from the list by removing the file '/var/log/ConsoleKit/history'

With lightdm, the last users appears even when :

  • removing /var/log/ConsoleKit/history
  • removing /var/lib/lightdm/.cache/unity-greeter/state

Where does lightdm store this list ?

Edit: It seems like it's using the content from the last command. Then purging the content of the file /var/log/wtmp is sufficient to remove any previously connected user from the list :

# > /var/log/wtmp

But, after doing this, I have the unwanted side effect that users loging in via lightdm doesn't appears at all in this list.

I must say that I'm in a enterprise network environment using NIS.

Edit2: Well, it seems that lightdm uses wtmp to display recent network users list, but does not update it. So, lightdm will show a network user only if it logged in in another fashion (ssh, login), like I did on this computer before. cf:

Edit3: I just added the following line to the file /etc/pam.d/lightdm To force lightdm to store users in wtmp :

session optional silent
share|improve this question
up vote 2 down vote accepted

So, to remove last connected network users from the list, just purge the /var/log/wtmp file :

# > /var/log/wtmp

Besides, to make lightdm remember last connected network users, one can add the following line to the file /etc/pam.d/lightdm :

session optional silent
share|improve this answer
I'll accept my own answer since no other answer came in. – Christophe Drevet-Droguet Nov 27 '12 at 12:15

I set /etc/lightdm/lightdm.conf as following to make the greeter screen not show the user list. Need to manually type in your username and password.

share|improve this answer
This disable the list altogether. My question was about purging the list, but still use it. The need came as I prepared computers for others, and didn't want my name to pollute the list on every computer out there. – Christophe Drevet-Droguet Feb 4 '14 at 6:58

The last user to log in with lightdm is stored here:


Note the dot in .cache.

It is safe to simply delete the file.

share|improve this answer

I was also searching for this and finally figured it out how to do this in Ubuntu 16.04.

It seems lightdm is getting the user list from /var/cache/lightdm/dmrc/. This folder contains a file with the name of each user that has logged into the machine. Just remove the files for the unwanted users from that dir and the greeter no longer shows them.

EDIT: And this is of course after the already suggested stuff has been done (clearing /var/log/wtmp and /var/log/btmp). If the users still stick after these, find any files/folders containing the users' names in the filesystem and remove them.

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.