» Linux » Examen sur Linux » Examen 202 : Networking Administration » Section 5 » Question 8/27
8.You have created special configuration files that you want copied to each user’s home directories when creating a new user accounts. You copy the files to /etc/skel.
Which of the following commands will make this happen?


useradd –m username
useradd –mk username
useradd –k username
useradd –Dk username

Explanation: The ‘–m’ option used with the useradd command is used to create the user’s home directory if it doesn’t already exist. The ‘k’ option is used to copy default files to the user's home directory. Meaningful only when used with the -m option. The default files are copied from /etc/skel/ unless an alternate dir is specified.

Reference: http://www.oreillynet.com/linux/cmd/u/useradd.html

Incorrect Answers
A: The ‘–m’ option used with the useradd command is used to create the user’s home directory if it doesn’t already exist. However, you need the ‘k’ option to copy the files.
C: The ‘k’ option can only be used with the ‘-m’ option.
D: The –D option is used to set or display default settings.

« Question 7 Question 9 »