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