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 need to create a user manually (need a specific uid and default group), but I would also like to be able to log in via the standard 12.04 login (lightdm). I cannot figure out a way to do both of these. If I created the user with the user accounts GUI, I cannot get the uid I want. If I create the user manually, it does not show up as an option on the log in screen.

share|improve this question
up vote 3 down vote accepted

Easiest workaround to me would be to change the UID of that user after you created that user. This is the command for it:

sudo usermod -u {uid_you_want_it_to_be} {your_username}

(side note: if you need to do this with the current user and do not want to create another account you can do this from the live cd too.)

Userid's by design do not show up when under 1000. You can change this though!

sudo gedit /etc/login.defs 

find ...

# Min/max values for automatic uid selection in useradd 
UID_MIN          1000
UID_MAX         60000

and change UID_MIN to 500 (or anything under 504 (but I would not go a lot lower))

share|improve this answer
I would think that would work, but it does not. I created a new user named 'bpotter' through the 'User Accounts' GUI. I could log in just fine with this on the main screen. I then logged back in to my separate administrative account and ran the usermod command you listed. sudo usermod -u 504 bpotter After doing this bpotter cannot be seen on the login screen or in the 'User Accounts' GUI. – bjcubsfan Apr 30 '12 at 15:53
Thanks @Rinzwind. After changing the login.defs file and rebooting, I can now login. – bjcubsfan Apr 30 '12 at 16:20
Ha thanks for the upvote and accept :D – Rinzwind Apr 30 '12 at 16:20

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.