102-500 Exam QuestionsBrowse all questions from this exam

102-500 Exam - Question 107


FILL BLANK -

What option to useradd creates a new user's home directory and provisions it with a set of standard files? (Specify only the option name without any values or parameters.)

Show Answer
Correct Answer:

The option to useradd that creates a new user's home directory and provisions it with a set of standard files is -m. The -m option stands for --create-home and ensures the user's home directory is created if it does not exist while copying the standard files from the skeleton directory, if any.

Discussion

17 comments
Sign in to comment
fantomas3239
Jan 16, 2021

-m is correct because the main point in the description is - in the skeleton directory: -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. From the question we have - and provisions it with a set of standard files?

yigido
Sep 11, 2020

can be “-m” If you use -d you need to specify a home directory

drliu1202
Aug 12, 2022

Answer is - m "-m Create a new user account with its home directory (if it does not exist)." https://learning.lpi.org/en/learning-materials/102-500/107/107.1/107.1_01/#:~:text=option%20is%20specified).-,%2Dm,account%20with%20its%20home%20directory%20(if%20it%20does%20not%20exist).,-%2DM -D is wrong "–D Display the default values" https://docs.oracle.com/cd/E88353_01/html/E72487/useradd-8.html#:~:text=on%20/home/%20username.-,%E2%80%93D,Display%20the%20default%20values,-for%20group%2C%20base_dir

wvdw1962
Feb 25, 2022

-D, --defaults print or change default useradd configuration -d, --home-dir HOME_DIR home directory of the new account -m, --create-home create the user's home directory So, in my opinion, it should be "-m"

lucaverce
May 26, 2022

The correct answer is -m From the MAN pages of useradd: ... OPTIONS -D, --defaults See below, the subsection "Changing the default values". ... Changing the default values When invoked with only the -D option, useradd will display the current default values. .... -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.

Stormy_Cloud
Feb 24, 2023

I don't understand why everybody is pointing the correct answer '-m' And the actual answer '-D' is not corrected ??? No one is bothering change it. Why I paid 32$ in order to see the entire test results ???

matthew_perry
Apr 30, 2023

++++ eto pizda

sugisho
Nov 11, 2020

# useradd --heip -d, --home-dir HOME_DIR home directory of the new account -D, --defaults print or change default useradd configuration -m, --create-home create the user's home directory

Rini_Giannenzo
Dec 31, 2020

In pratica è -m poichè -d non crea la cartella se non esiste HOME_DIRE.

Chenar
Jun 17, 2021

-d is the correct answer.

CuriousLinuxCat
Aug 9, 2021

If, we can assume that the configuration file of useradd (/etc/defaults/useradd) has not been edited, then we must FORCE useradd to create a home directory by default by using the '-m' option to OVERRIDE defaults. $ sudo useradd -m test If the Linux administrator has defined the defaults in the (/etc/defaults/useradd), where the admin wishes to create a home directory for every user, then it is safe to use the -D option.

Lazylinux
Apr 27, 2022

Definitely -m creates Home directory - see below options as per man page and for those say -D obviously have no clue as it prints out the default values that will be assigned to the user once created..What they should have said is NOT -D but -d, when using -d yes you create home directory for user BUT only used when you want to specify home directory for user NOT in traditional location i.e. /home and not with username, so something like /usr/MaxHome then you can use the -d but the question did not say that and said home directory and hence -m

Lazylinux
Apr 27, 2022

-D, --defaults print or change default useradd configuration -e, --expiredate EXPIRE_DATE expiration date of the new account -f, --inactive INACTIVE password inactivity period of the new account -g, --gid GROUP name or ID of the primary group of the new account -G, --groups GROUPS list of supplementary groups of the new account -k, --skel SKEL_DIR use this alternative skeleton directory -K, --key KEY=VALUE override /etc/login.defs defaults -l, --no-log-init do not add the user to the lastlog and faillog databases -m, --create-home create the user's home directory -M, --no-create-home do not create the user's home directory -N, --no-user-group do not create a group with the same name as the user

KiddyLitty
May 10, 2022

-D is just print or change default values (not create any folder) -m will surely create home directory even if not existed, and that folder will include all standard files or folder from SKEL folder. Answer should be - "-m"

KiddyLitty
May 10, 2022

useradd -D userX will not create any "user or home directory" but, useradd -m userX will create userX with standard home directory

k3n_
Feb 28, 2023

Answer: -m -m options will create the directory. -d option needs an already created directory The question asks for a option that creates a new home's directory with a set of default files... -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. useradd will create the home directory unless CREATE_HOME in /etc/login.defs is set to no. -d, --home HOME_DIR The new user will be created using HOME_DIR as the value for the user's login directory. The default is to append the LOGIN name to BASE_DIR and use that as the login directory name. The directory HOME_DIR does not have to exist but will not be created if it is missing. Source: linux.die.net/man/8/useradd

TheChild
Jan 19, 2022

When invoked without the -D option, the useradd command creates a new user account using the values specified on the command line plus the default values from the system. Right answer it is -D

Robert12
Feb 5, 2022

I don't agree with -D , the man page just says See below, the subsection "Changing the default values". So it seems you have to have another parameter with the -D and the list given doesn't mention anything about adding a set of standard files. I think it could be -md

k3n_
Mar 25, 2023

Should i answer with (create_home) or -m?

BrascoChe
Oct 13, 2023

-m is the right answer