When i start my Ubuntu 18.04 system i get prompted to the login screen but my user appears twice in the login screen the first instance accepts my usual password but the second instance doesnt what does this mean? how can i remove the second instance?

to be more clear, i don't get TWO login screens, instead one login screen with my user duplicated in it. thanks in advance.

I tried to look for the file at which the login entries was present, but didn't find it and didn't find a bug like mine.

  • 2
    Do you perhaps have two different accounts configured with the same GECOS fullname (which is the field displayed in the GUI login box, iirc)? Something like getent passwd | awk -F: '$3+0 > 500 {print $5}' might help to confirm. – steeldriver Jul 29 '18 at 22:58
  • yeah thats right! how did that happen and how to fix it? – Mohamed Ashref Jul 29 '18 at 23:06
  • You should be able to do that using the chfn command - please see below – steeldriver Jul 29 '18 at 23:27

This can happen if two user accounts have the same GECOS full name.

You can check the usernames and GECOS records for all the (likely) non-system accounts using

getent passwd | awk -F: '$3+0 > 500 {print $1 ": " $5}'

If there's a duplicate in the fullnames (the first comma-separated field of the GECOS record), then you can change one or other (or both, if you prefer) using the chfn command e.g.

sudo chfn -f 'new name for userX' userX

If you don't even want to see an entry for one of the accounts, then you can hide it from the greeter altogether - see How do I hide a particular user from the login screen?

Of course, if the account was created in error you can delete it - but be sure to back up any data just in case.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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