Introduction to the/etc/default/useradd file
First, check the content of the/etc/default/useradd file and prompt useradd default file.
# Useradd defaults file
GROUP = 100
HOME =/home
INACTIVE =-1
EXPIRE =
SHELL =/bin/bash
SKEL =/etc/skel
CREATE_MAIL_SPOOL = yes
What does each parameter value mean?
GROUP = 100 indicates the user GROUP ID
HOME =/HOME indicates the location of the HOME Directory
INACTIVE =-1 indicates whether to enable account expiration and suspension, and-1 indicates not to enable.
EXPIRE = indicates whether the account has enabled the expiration setting. None indicates that the account is not enabled.
SHELL =/bin/bash indicates the shell type used by the account
SKEL =/etc/skel indicates that the Account uses the default file content, which can be understood as the default file storage location for the added user directory. That is to say, when a user uses useradd to add a user, all the files in the user's home directory are copied from this directory.
CREATE_MAIL_SPOOL = yes indicates whether to create the email cache. yes indicates creation.
When adding a user, you need to modify the content in the/etc/skel file to add the mojo folder under the Home directory by default. The example is as follows:
[Root @ localhost ~] # Touch/etc/skel/mojo
[Root @ localhost ~] # Ll-a/etc/skel/mojo
-Rw-r -- 1 root 0 Apr 12 09:06/etc/skel/mojo
[Root @ localhost ~] # Useradd inds01
[Root @ localhost ~] # Ll/home/inds01/
Total 0
-Rw-r -- 1 inds01 inds01 0 Apr 12 09:04 mojo
[Root @ localhost ~] #
Basic Linux Tutorial:/etc/default/useradd file
This article permanently updates the link address: