DebianThis forum is for the discussion of Debian Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
-r
This flag is used to create a system account. That is, a user with a UID lower than the value of UID_MIN defined in /etc/login.defs and whose password does not expire. Note that useradd will not create a home directory for such an user, regardless of the default setting in /etc/login.defs. You have to specify -m option if you want a home directory for a system account to be created. This is an option added by Red Hat.
-M
The user home directory will not be created, even if the system wide settings from /etc/login.defs is to create home dirs.
Hitest, there are plenty of reasons to do this, for example the user apache on redhat has a home directory of /var/www which already exists. Note the difference between having a home directory and creating one when you add a user.
Distribution: Debian. (Formerly Slackware, Gentoo, RHEL, and Suse)
Posts: 80
Rep:
I don't know why, but on my Etch install - at least in the VM one that I'm using at the mo, useradd does not create a home directory by default, you have to pass the lowercase -m switch to get it to do it.
I'm pretty sure that's the case on my 2 installs at home as well. (I've felt the love for deb in a big way and have it running all over the place .
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.