为什么 useradd 还没有创建标准文件?

rɑː*_*dʒɑ 0 centos useradd

请参阅我使用useradd命令在我的 CentOS 中创建了一些用户。而且我没有得到任何类型的自动标准目录创建,而且在我创建该用户时它实际上并不是通用的。请看日志。

root@localhost raja]# useradd positiveman
[root@localhost raja]# passwd positiveman
Changing password for user positiveman.
New password:
BAD PASSWORD: it does not contain enough DIFFERENT characters
BAD PASSWORD: is too simple
Retype new password:
passwd: all authentication tokens updated successfully.
[root@localhost raja]# ls /home/august
[root@localhost raja]# ls /home/august/
[root@localhost raja]# cd /home/
[root@localhost home]# ls
august  positiveman  raja
[root@localhost home]# cd august/
[root@localhost august]# ls
[root@localhost august]# cd ..
[root@localhost home]# cd positiveman/
[root@localhost positiveman]# ls
[root@localhost positiveman]#
Run Code Online (Sandbox Code Playgroud)

可能是什么原因?

Zel*_*lda 5

您必须提供一些选项useradd来创建目录。您可以在man页面中找到这些:

-m, --create-home
       Create the user's home directory if it does not exist. The files
       and directories contained in the skeleton directory (which can be
       defined with the -k option) will be copied to the home directory.

       By default, if this option is not specified and CREATE_HOME is not
       enabled, no home directories are created.
Run Code Online (Sandbox Code Playgroud)