The-d parameter in the Useradd command is not useful

Source: Internet
Author: User

os:red Hat Enterprise Linux Server Release 7.0 (MAIPO)

There is not much understanding of Linux systems. Some operations retain heavy windows habits.

Now/home was used by me as a warehouse, I gave it a lot of space, and stuffed many files and directories inside. So I think it would be a very painful thing to do if the home directory of multiple users is scattered in the/s directory.

So I decided to put all the user directories under/home/myusers.

The-d parameter in the Useradd command can be followed by the directory, so enter the following command:

[Email protected]/]# useradd-d/home/myusers user1

However, there are no eggs to use. Do not know whether because of posture problem,/home/myusers directory can not always automatically generate User1 directory. The egg is aching unceasingly.

Finally, let me search this article-- a little something about Useradd. , which describes the location of the new user's home directory is specified by the/etc/default/useradd file. There is a statement inside: Home=/home

So I can get rid of this value and realize my purpose.

[[email protected]/]# Cat/etc/default/useradd # useradd Defaults filegroup=100home=/home/myusers # change here Inactive=-1exp Ire=shell=/bin/bashskel=/etc/skelcreate_mail_spool=yes

This allows the user's home directory to be set up in/home/myusers without adding parameters when using Useradd.

[Email protected]/]# Useradd user1

The-d parameter in the

Useradd command is not good

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.