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.

How can I add a new user "Kids" with UID = 500 and without home directory with adduser command in terminal? I'm trying this: sudo adduser --no-create-home --uid ID 500 Kids and after correctly entering password it says that value "ID" is invalid for option uid. Then I have tried the same thing only without "ID" and got: Please enter a username matching the regular expression configured via the NAME_REGEX[_SYSTEM] configuration variable. Use the `--force-badname' option to relax this check or reconfigure NAME_REGEX.

share|improve this question

2 Answers 2

First - UIDs less than 1000 are usually system reserved, pick a higher UID.

Second - Why are you wanting it to not have a home directory. Keep in mind the --no-create-home doesn't mean the user doesn't have a home directory assigned, it just isn't created. An error will be logged every time that user logs in.

Third - Please remember to post errors your get, else we can only assume as to what the problem is. I'm assuming it has to do with the name format, in which case, you can bypass this using --force-badname, as the error message would say, or use all lower case characters.

*edit typo

share|improve this answer

adduser command will let you include all the default home directories automatically. So you can not with adduser directly.

you can use useradd instead.

sudo useradd <username>

will create the user with the given user name.

While coming to UID , the Range 499 reserved for system users i.e in Linux each service creates its own user and below 499 UID will allocated for those users.
hope that helps.

share|improve this answer

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.