Sie sind auf Seite 1von 12

NDG Linux Essentials 2.

0 Chapter 15 Exam Answers


1. Which files contain user account information?
(choose two)
 /etc/shadow
 /etc/group
 /etc/passwords
 /etc/passwd

2. Which user can view the /etc/shadow file?

 Any member of the password group


 No users
 The root user
 All users

3. Which command will display the UID, GID and groups your current
user belongs to?
 whoami
 Who
 id
 about

4. Each user belongs to at least one group.


True or False?
 True
 False

5. Which command will display the users that are currently logged in to
the system?
 about
 who
 id
 whoami

6. The sudo command allows regular users to…

 …execute commands as another user.


 …execute any command as root, after providing the root password.
 …run any command as root, after providing the sudo password.
 …run any commands as a system account without logging in.

7. Which of the following commands will display the group(s) a user
belongs to?
 all
 id
 whoami
 group

8. Which of the following commands will display the groups that the
user bob belongs to?
 group bob
 id bob
 groups -a
 all bob

9. The /etc/group file follows what structure?


 group:GID:user_list
 groups -a
 user:group
 group_name:password_placehoder:GID:user_list

10. A GID is associated with a group name.


True or False?
 True
 False

11. A user can belong to…


 At least 16 groups
 Only five groups
 Only groups with a GID over 500
 Only one group

12. Sudo privileges can be used to specify which user can use
the sudo command to execute commands as other users.
True or False?
 True
 False

13. In distributions that do not allow the root user to login directly
or via the su command, the installation process automatically
configures one user account to be able to use the sudo command to
execute commands as if they were executed by the root user.
True or False?
 True
 False

14. Which of the following commands will display how long the
system has been running since the last boot?
(choose two)
 who
 id
 uptime
 w

15. The /etc/shadow file contains plain-text passwords.


True or False?
 True
 False

16. Which command can be used to view the /etc/passwd file


entries?
 uptime
 uppasswd
 getpasswd
 getent

17. All Linux systems allow administrators to log in as root.


True or False?
 True
 False

18. What is the default user for the su command?


 All users
 The root user
 Any member of the password group
 The most recently created user

19. Which command would allow a user to execute commands as
root?
 whoami
 about
 sudo
 who
 grep

20. File permissions cannot be edited by the root user.


True or False?
 True
 False

21. Which command is used to display only the user’s primary


group?
 who
 id -g
 man
 whoami
 about

22. Traditional UNIX systems allowed users to belong to how many


groups?
 10,000
 1
 65,000
 256
 16

23. What would an account with the UID 376 typically be used for?
 White hat hackers.
 Temporary employees.
 New users with full privileges.
 System service access.
 Root user access.

24. Usernames cannot be the same as group names.


True or False?
 True
 False

25. To display the group(s) a user belongs to use this command:
 all
 id
 grep
 group
 whoami

26. Which command will display the groups that the root user
belongs to?
 all -t
 groups -a
 id root
 all
 group -r

27. A value of 0 in the “minimum” password aging field means the


user cannot change their password.
True or False?
 True
 False

28. The “Epoch” began on January 1, 1970.


True or False?
 True
 False

29. The last command displays reboot records…


 By default
 Never
 Only when issued by the root user
 After restarting the system
 When issued with the -p switch

30. Sudo privileges allow users to execute commands as another


user.
True or False?
 True
 False

31. When using the sudo command to execute a command as
the root user, the command prompts for the user’s own password,
not that of the root user.
True or False?
 True
 False

32. The first line of this command displays how long the system
has been running since being rebooted.
 su
 getent
 w
 id
 who

33. The /etc/shadow file contains encrypted passwords.


True or False?
 True
 False

34. Which command can be used to view the /var/log/wtmp file


entries?
 getent
 uptime
 getpasswd
 uppasswd
 last
NDG Linux Essentials 2.0 Chapter 16 Exam Answers
1. UIDs 1-499 are usually reserved for what kind of users?
 Remote log-in accounts
 Are not used for user accounts, but for group accounts
 System accounts, such as server processes
 Log-in (human) users

2. If a user is deleted, the files and directories that the user owned…
 …will have no user owner.
 …will have no UID owner.
 …will show a UID as the owner, but not user name.
 …are deleted as well.

3. Which of the following options for the useradd command allows root
to specify the UID to be associated with the account?
 -g
 -G
 -u
 -M

4. Which of the following options for the useradd command allows root
to specify supplementary groups the user will be a member of?
 -G
 -u
 -g
 -U

5. On a system that does not use UPG, the useradd command will also
create a user group. For example, user bob, group bob.
True or False?
 True
 False

6. Which of the following commands will add the group extra to the
user bob‘s secondary groups in addition to bob‘s current secondary
groups?
 usermod -G extra bob
 usermod -ag bob extra
 usermod -aG extra bob
 usermod -a extra bob

7. Which option for the usermod command can be used to specify a
user’s group ID (either primary or secondary)?
(choose two)
 -s
 -g
 -S
 -G

8. For non-root users, the passwd command can only be used to change
the password of the user running the command.
True or False?
 True
 False

9. The groupmod command can be used to change a group name.


True or False?
 True
 False

10. The groupmod command can be used to change a group GID.


True or False?
 True
 False

11. The groupmod command can be used to add users to a group.


True or False?
 True
 False

12. Which of the following commands can be used to modify a


group?
 groupmod
 groupadd
 modgroup
 addgroup

13. Which command can be used to determine a user’s most recent


log in?
 history
 last
 login
 shell
14. Which of the following files contains encrypted user password
information?
 /etc/usr
 /etc/group
 /etc/passwd
 /etc/shadow

15. Which of the following files contains user IDs?


 /etc/group
 /etc/passwd
 /etc/usr
 /etc/shadow

16. Which of the following files does the groupadd command use to
determine the new GID when a GID isn’t specified?
 /etc/usr
 /etc/shadow
 /etc/passwd
 /etc/group

17. Which of the following commands, run as root, will prevent the
user bob from logging in?
 usermod -L bob
 usermod -l bob
 usermod -D bob
 usermod -d bob

18. What directory contains a user’s home directory?


 /user
 /
 /home
 /rootfs

19. GIDs under 500 (or 1000) are usually reserved for what kind of
groups?
 System use
 Are not used for groups, but for user accounts
 Administrators
 User private groups (UPG)

20. If a user is deleted, the files and directories that the user
owned…
 …are deleted as well.
 …will have no user owner.
 …may be important for others in the organization
 …will have no UID owner.

21. Which of the following options for the useradd command allows
you to use a different primary group then the default?
 -g
 -G
 -U
 -u

22. On a system that uses UPG, the UID must not be the same as
the GID..
True or False?
 True
 False

23. The usermod command can be used to unlock a users account


with the following option.
 -s
 -u
 -f
 -U

24. Which of the following options for the useradd command allows
you to use a different login shell than the default?
 -g
 -s
 -u
 -U

25. Which of the following commands will add the group extra to
the user jane’s secondary groups in addition to jane‘s current
secondary groups?
 usermod -a extra jane
 usermod -ag jane extra
 usermod -aG extra jane
 usermod -G extra jane

26. Which option for the usermod command can be used to specify a
user’s primary group ID?
 -g
 -S
 -G
 -s

27. For root users, the passwd command can only be used to change
the password of the user running the command.
True or False?
 True
 False

28. The userdel -r command will…


 …will prompt before deleting each file owned by a user.
 …delete the user account, but leave the user’s files by default.
 …automatically delete a user and the user’s home directory and mail spool and
their contents.
 …automatically delete a user and all the files owned by that user.

29. The groupmod command can be used to change a group name.


True or False?
 True
 False

30. The groupmod command cannot be used to change a group GID.


True or False?
 True
 Fasle

31. The groupdel command can be used to delete primary groups.


True or False?
 True
 Fasle

32. Which of the following commands can be used to modify a


user?
 adduser
 moduser
 useradd
 usermod

33. Which command can be used to determine a user’s most recent


log in?
 history
 shell
 login
 last
34. The /etc/passwd file contains encrypted user password
information. True or False?
True or False?
 False
 True

35. Which of the following files contains group IDs?


 /etc/passwd
 /etc/usr
 /etc/shadow
 /etc/group

36. Which command allows you to view or change some of the


default values used by the useradd command?
 useradd -D
 useradd -r
 modvalue
 useradd -f

37. Which of the following commands, run as root, will prevent the
user jane from logging in?
 usermod -d jane
 usermod -D jane
 usermod -L jane
 usermod -l jane