Thursday, February 14, 2008

Test Your Knowledge of Users and Groups by Emmett Dulaney :

Test Your Knowledge of Users and Groups by Emmett Dulaney :

If there is one thing that all administrators deal with on a regular basis, it is users and groups. If there is
one topic that you should know inside and out, it is users and groups.
That said, following are 50 questions
intended to test your knowledge of user and group fundamentals at an intermediate level.

Good luck (answers are at the end of the article)!

1. What is the default UID number assigned to the first user added to a system on most systems?

A. 1
B. 100
C. 1000
D. 10000



2. Which command can be used at the command line to change your active GID to a new one?

A. chgroup
B. group
C. newgrp
D. switch


3. Which field of the /etc/passwd file identifies the user’s primary group ID?

A. 1
B. 3
C. 4
D. 5
E. 6
F. 7

4. NIS entries are automatically added to your system. What character precedes entries in /etc/passwd for which
this is done?

A. +
B. !
C. ?
D. %

5. How many fields does the /etc/shadow file consist of?

A. 7
B. 9
C. 12
D. 15

6. Which command can be used to see a user’s password aging information?

A. useradd -l
B. passwd -l
C. chage -l
D. usermod -l

7. If the passwords are stored in /etc/shadow instead of /etc/passwd, what single letter is found in the second column
of /etc/passwd entries? __________ (Fill in the blank.)

8. Who owns the /etc/group file?

A. root
B. bin
C. daemon
D. nobody

9. Which tool can be used to create a user account with default values?

A. pwck
B. useradd
C. usermod
D. chfn

10. Which module can PAM use to enforce strong passwords (choose the best answer)?

A. pam_strong
B. pam_usersec
C. pam_pwcheck
D. pam_cracker

11. Instead of logging in as root regularly, you have advised all administrators to use sudo. Which files logs
all sudo commands?

A. /tmp/sudo/log
B. /var/sudolog
C. /etc/sudo/log
D. /var/log/messages

12. The root user, on every system, always has the same UID. What is its value?

A. 0
B. 1
C. 10
D. 100

13. Within the member list field of the /etc/group file, what character is used to separate members?

A. a colon (:)
B. a comma (,)
C. a period (.)
D. a pipe (|)

14. By default, what utility is used to hash the passwords that appear in /etc/shadow?

A. hash
B. encode
C. pgp
D. crypt

15. Which file can be used to limit which users can use sudo?

A. /etc/sudo
B. /etc/sudoers
C. /etc/sudo/accept
D. /etc/accept

16. In Ubuntu, which utility can be used to add a new user to the system?

A. makeuser
B. newuser
C. adduser
D. usermake

17. Which command is used to change an NIS user’s password?

A. nispasswd
B. yppasswd
C. passwd -nis
D. gpasswd

18. How many fields are there in the /etc/group file?

A. 4
B. 5
C. 6
D. 7

19. Which field of the /etc/passwd file identifies the home directory for the user?

A. 1
B. 3
C. 4
D. 5
E. 6
F. 7

20. If you want to run su and not only become the other user, but also run their login shell, which option should
you specify?

A. -
B. -l
C. -r
D. -s

21. What character is used as a delimiter between fields in the /etc/passwd file? __________ (Fill in the blank.)



22. In the /etc/shadow file, dates are specified for when the password was set/changed and the absolute last date
that it can be used. This is expressed as a number of days since when?

A. January 1, 1970
B. December 31, 1969
C. December 25, 1968
D. November 30, 1967

23. Which PAM module examines the home directory of the user for files/directories that have dangerous permissions and
issues a warning if there are any there?

A. pam_env.so
B. pam_homecheck.so
C. pam_securetty.so
D. pam_unix2.so

24. In the following /etc/shadow entry, which value indicates the number of days after a password has expired that
the account is disabled and cannot be used?

edulaney:PcaQWn6d1la5.:13000:0:1:2:3:14000:

A. 0
B. 1
C. 2
D. 3

25. Which field of the /etc/passwd file holds the UID?

A. 1
B. 3
C. 4
D. 5
E. 6
F. 7

26. What is the default GID number assigned to the first group added to a system on most systems?

A. 1
B. 100
C. 1000
D. 10000

27. Which command can be used to add a new user to an existing group?

A. groupadd -g
B. groupmod -g
C. useradd -g
D. usermod -g

28. For security reasons, you want to prevent the use of finger and the values that are returned to it from /etc/passwd. Which port should be blocked at the firewall?

A. 49
B. 59
C. 69
D. 79

29. What character should be added to an account entry to disable it? __________ (Fill in the blank.)

30. Which command can be used to add an existing user to an existing group?

A. groupadd -g
B. groupmod -g
C. useradd -g
D. usermod -g

31. If you want to run su and not only become root, but also use root’s environmental variables. Which option should you specify?

A. -
B.-c
C. -r
D. -s

32. Which of the following files holds the default password aging information for newly created accounts?

A. /etc/inittab
B. /etc/defaults/passwd
C. /etc/defaults/aging
D. /etc/login.defs

33. Which PAM module verifies that the username name given is valid (exists in passwd and shadow)?

A. pam_env.so
B. pam_homecheck.so
C. pam_securetty.so
D. pam_unix2.so

34. Which field of the /etc/passwd file identifies the default shell to use when the user logs in?

A. 1
B. 3
C. 4
D. 5
E. 6
F. 7

35. In the following /etc/shadow entry, which value indicates the maximum number of days the password can be used before it must be changed?

edulaney:PcaQWn6d1la5.:13000:0:1:2:3:14000:

A. 0
B. 1
C. 2
D. 3

36. Which command is used to convert passwords from /etc/password entries into /etc/shadow entries?

A. pwconv
B. pwunconv
C. convert
D. unshadow

37. The root user, on every system, always has the same group ID (GID) value. What is that value?

A. 0
B. 1
C.10
D. 100

38. Which tool can be used to change CGOS values?

A.pwck
B. useradd
C. usermod
D. chfn

39. Which command is used to change an LDAP password?

A. passwdldap
B. lpasswd
C. ldappaswd
D. yp

40. Which of the following system accounts has a default GID of 1?

A. bin
B. mail
C. uucp
D. named

41. Which field of the /etc/passwd file holds the login name?

A. 1
B. 3
C. 4
D. 5
E. 6
F. 7

42. Which of the following files holds default values assigned to newly created user accounts?

A. /etc/default/useradd
B. /etc/users/default
C. /etc/useradd/users
D. /etc/default

43. Which command-line utility can be used in Ubuntu to remove a group?

A. ungroup
B. group_rm
C. rmgroup
D. delgroup

44. Within which directory does su reside by default?

A. /bin
B. /etc
C. /usr
D. /var

45. Which PAM module verifies that the root user is allowed access from the current terminal?

A. pam_env.so
B. pam_homecheck.so
C. pam_securetty.so
D. pam_unix2.so

46. In the following /etc/shadow entry, which value indicates the minimum number of days the password has to be used
before it can be changed?

edulaney:PcaQWn6d1la5.:13000:0:1:2:3:14000:

A. 0
B. 1
C. 2
D. 3

47. Which tool can be used to check the integrity of the passwd and shadow files?

A. pwck
B. useradd
C. usermod
D. chfn

48. Which command is used to convert passwords from /etc/shadow entries into /etc/passwd entries?

A. arsort()
B. rev()
C. trosa()
D. zsort()

49. Which field of the /etc/passwd file is known as the GCOS field?

A. 1
B. 3
C. 4
D. 5
E. 6
F. 7

50. Which of the following system accounts has a default UID of 10?

A. bin
B. mail
C. uucp
D. named




Answers

1. The default user ID number on most systems is 1000, and the numbers then increment by one from there with each newly
added user. Answer: C.

2. The newgrp command can be used at the command line to change your active GID to a new one.
Answer: C.

3. The fourth field of /etc/passwd identifies the GID.
Answer: C.

4. The plus sign (“+”) precedes entries in /etc/passwd for which NIS inserts values. Answer: A.

5. There are nine fields in the /etc/shadow file.
Answer: B.

6. The chage –l command can be used to see a user’s password aging information (for example, chage –l edulaney).
Answer: C.

7. An “x” in the second column of /etc/passwd indicates that the password values are being stored in /etc/shadow.

8. The root user, by default, owns the /etc/group file.
Answer: A.

9. The useradd tool can be used to create a user account with default values.
Answer: B.

10. PAM can use the pam_pwcheck module to enforce strong passwords.
Answer: C.

11. The /var/log/messages file logs all sudo commands.
Answer: D.

12. The UID number for root is always 0.
Answer: A.

13. Within the member list field of the /etc/group file, a comma is used to separate members.
Answer: B.

14. The crypt utility is used to hash the passwords that appear in /etc/shadow.
Answer: D.

15. The /etc/sudoers file can be used to limit which users can use sudo.
Answer: B.

16. The adduser utility can be used to add a new user to the system.
Answer: C.

17. The yppasswd command is used to change an NIS user’s password.
Answer: B.

18. The /etc/group file consists of four fields.
Answer: A.

19. The sixth field of /etc/passwd identifies the user’s home directory.
Answer: E.

20. To run su and not only become the other user, but also run their login shell, specify the -l (login) option.
Answer: B.

21. Answer: The colon (“:”) is used as a delimiter between fields in the /etc/passwd file.

22. Values are expressed as the number of days since January 1, 1970.
Answer: A.

23. The pam_homecheck.so module performs this function.
Answer: B.

24. The seventh field of an /etc/shadow entry – holding a “3” in this case – indicates the number of days after the
password expires before the account is disabled.
Answer: D.

25. The third field of /etc/passwd holds the UID.
Answer: B.

26. The first group added to most systems begins at 100 and increments from there with each newly added group.
Answer: B.

27. The useradd –g command can be used to add a new user to an existing group.
Answer: C.

28. The finger port to block is 79.
Answer: D.

29. Answer: An asterisk (“*”) character should be added to an account entry to disable it.

30. The usermod –g command can be used to add an existing user to an existing group.
Answer: D.

31. Using just the dash (su -), you not only become root, but also use root’s environmental variables.
Answer: A.

32. The /etc/login.defs file holds the default password aging information for newly created accounts.
Answer: D.

33. The pam_unix2.so module performs this function.
Answer: D.

34. The seventh field holds the login shell path. If no value is given, the default shell is assigned.
Answer: F.

35. The fifth field of an /etc/shadow entry – holding a “1” in this case – indicates the maximum number of days the
password can be used before it must be changed.
Answer: B.

36. The pwconv command is used to convert passwords from /etc/password entries into /etc/shadow entries.
Answer: A.

37. The primary GID number for root is 0.
Answer: A.

38. The chfn tool can be used to change CGOS values.
Answer: D.

39. The ldappaswd utility is used to change an LDAP password.
Answer: C.

40. By default, the bin account has a UID and GID of 1.
Answer: A.

41. The first field holds the login name.
Answer: A.

42. The /etc/default/useradd file holds default values assigned to newly created user accounts.
Answer: A.

43. The delgroup command-line utility can be used in Ubuntu to remove a group.
Answer: D.

44. The su utility resides beneath /bin.
Answer: A.

45. The pam_securetty.so module performs this function.
Answer: C.

46. The fourth field of an /etc/shadow entry – holding a “0” in this case – indicates the minimum number of days the
password has to be used before it can be changed.
Answer: A.

47. The pwck tool can be used to check the integrity of the passwd and shadow files.
Answer: A.

48. The pwunconv command is used to convert passwords from /etc/shadow entries into /etc/passwd entries.
Answer: B.

49. The fifth field is the GCOS (General Electric Comprehensive Operating System) field. It holds free text that is
identifies the user and is often used to return values with finger.
Answer: D.

50. By default, the special account uucp has the UID of 10. Answer: C.

Emmett Dulaney is the author of the several books on Linux/Unix and certification as well as a columnist for UnixReview.
Emmett’s blog can be found at http://edulaney.blogspot.com and he can be reached
(and welcomes your comments) at edulaney@insightbb.com.

No comments: