3

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.

1 Answer 1

3

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))

2
  • 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, 2012 at 15:53
  • Thanks @Rinzwind. After changing the login.defs file and rebooting, I can now login.
    – bjcubsfan
    Apr 30, 2012 at 16:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .