Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

1 Answer 1

up vote 2 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

 
discard

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.