Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I encountered a question in the Redhat Skills Assessment regarding useradd:
Which of the following CANNOT be defined when you create a user account with useradd?
a* A password expiration date.
b* The user's primary group.
c* The user's default shell.
d* The user's NIS or LDAP group.
e* The user's home directory.
Which is the corret answer? I have my own thinking which will be explained later.
-e, --expiredate EXPIRE_DATE
The date on which the user account will be disabled. The date is specified in the format YYYY-MM-DD.
-g, --gid GROUP
The group name or number of the user's initial login group. The group name must exist. A group number must refer to an already existing group. /etc/default/useradd.
-s, --shell SHELL
The name of the user's login shell. The default is to leave this field blank, which causes the system to select the default login shell.
-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.
In the useradd man page, -e DATE specifies the date on which the account will be expired, not the password expiration date. The password expiration date can be changed via -M option of chage command. In some man page (I forget which), it says account expiration is different from password expiration.
Should I say, a) and d) are both the correct answer?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.