LPI Linux Essentials
Knowledge Domain Topic 5:
Security and File Permissions
Practice Test Questions #1:
1. What is the significance of UIDs starting at 1000 (4 digits), although some legacy systems may start at 500?
A. UIDs starting at 1000 indicate that the user is a member of a system group.
B. UIDs starting at 1000 indicate that the user is a root user.
C. UIDs starting at 1000 indicate that the user is a standard user.
D. UIDs starting at 1000 indicate that the user is a legacy user.
/* --------------------- */
--------------------------
1 Answer Below:
--------------------------
/* --------------------- */
In Linux, UIDs (User IDs) are assigned to each user, and UIDs starting at 1000 are typically reserved for standard users. Some legacy systems may start UIDs at 500 instead of 1000, but this is not as common. UIDs starting at 0 are reserved for the root user.
Option A is incorrect because being a member of a system group does not depend on the UID. Option B is incorrect because UIDs starting at 0, not 1000, indicate the root user. Option D is incorrect because the term "legacy user" is not a commonly used term in Linux.
1. Answer: C. UIDs starting at 1000 indicate that the user is a standard user.
2. What is the purpose of a defined home directory in Linux?
A. It provides a location for user-specific configuration files.
B. It provides a location for system configuration files.
C. It provides a location for shared files between users.
D. It provides a location for system logs.
/* --------------------- */
--------------------------
2 Answer Below:
--------------------------
/* --------------------- */
In Linux, each user typically has a defined home directory, which is usually a subdirectory of /home. The home directory provides a location for user-specific configuration files and data, such as .bashrc, .profile, and other settings.
Option B is incorrect because system configuration files are not stored in a user's home directory. Option C is incorrect because shared files between users are typically stored in a shared directory, not in individual user's home directories. Option D is incorrect because system logs are typically stored in /var/log, not in a user's home directory.
2. Answer: A. It provides a location for user-specific configuration files.
3. What is the purpose of a defined login shell in Linux?
A. It provides a way for users to access remote servers.
B. It provides a way for users to run graphical applications.
C. It provides a way for users to run commands and scripts.
D. It provides a way for users to browse the web.
/* --------------------- */
--------------------------
3 Answer Below:
--------------------------
/* --------------------- */
In Linux, each user typically has a defined login shell, which is the command interpreter that runs when the user logs in. The login shell provides a way for users to run commands and scripts, and to interact with the system through the command line interface.
Option A is incorrect because remote server access is typically provided through a separate program or protocol, such as SSH or Telnet. Option B is incorrect because graphical applications typically run within a graphical environment, such as X Windows, and are not directly related to the login shell. Option D is incorrect because browsing the web is typically done through a separate program or application, such as a web browser.
3. Answer: C. It provides a way for users to run commands and scripts.
4. What are User and Group Identifiers (UIDs/GIDs) in Linux?
A. Unique system identifiers for hardware devices.
B. Basic, enumerated references to user accounts.
C. Reserved identifiers for system processes.
D. Identifiers for network interfaces.
/* --------------------- */
--------------------------
4 Answer Below:
--------------------------
/* --------------------- */
In Linux, User and Group Identifiers (UIDs/GIDs) are the basic, enumerated references to user accounts. UIDs and GIDs are assigned to each user and group, respectively, and are used to control access to files, directories, and system resources.
Option A is incorrect because UIDs and GIDs are not related to hardware devices. Option C is incorrect because reserved identifiers for system processes are typically defined in the /etc/passwd and /etc/group files, just like regular users and groups. Option D is incorrect because network interfaces are identified by their MAC addresses, not UIDs or GIDs.
4. Answer: B. Basic, enumerated references to user accounts.
5. What is the primary group for a user in Linux?
A. The group with the same name as the user's username.
B. The group with the lowest GID on the system.
C. The group with the highest GID on the system.
D. The group with the same name as the user's home directory.
/* --------------------- */
--------------------------
5 Answer Below:
--------------------------
/* --------------------- */
By default on Linux systems, every user is assigned to a group with the same name as their username, and the same GID as their UID. This group is considered the primary group for the user.
Option B is incorrect because the lowest GID on the system may not be related to the user's primary group. Option C is incorrect because the highest GID on the system may not be related to the user's primary group. Option D is incorrect because the user's home directory and username are not necessarily related to each other.
5. Answer: A. The group with the same name as the user's username.
6. What is the default group for the superuser account on Linux?
A. The group with the same name as the superuser's username.
B. The group with the highest GID on the system.
C. The group with the lowest GID on the system.
D. The group with the GID 0 and the name root.
/* --------------------- */
--------------------------
6 Answer Below:
--------------------------
/* --------------------- */
On Linux systems, the superuser account is root, which always has the UID 0. The default group for the superuser has the GID 0 and is also named root.
Option A is incorrect because the superuser's username is root, not a group name. Option B is incorrect because the highest GID on the system may not be related to the superuser's default group. Option C is incorrect because the lowest GID on the system may not be related to the superuser's default group.
6. Answer: D. The group with the GID 0 and the name root.
7. What is the usual range of UIDs for system accounts?
a) 1000-65535
b) 500-1000
c) 100-999
d) 0-99
/* --------------------- */
--------------------------
7 Answer Below:
--------------------------
/* --------------------- */
Explanation: System accounts are typically pre-created at system installation time and usually have UIDs that are less than 100 or between 500 and 1000. This is the usual range of UIDs for system accounts, as stated in the note. Option a) is incorrect because this range is for regular user accounts, not system accounts. Option b) is partly correct, but it does not include the UIDs under 100. Option c) is also incorrect because it does not include the UIDs under 100.
7. Answer: d) 0-99
8. What is the usual login shell for system accounts?
a) /bin/bash
b) /sbin/nologin
c) /bin/sh
d) /usr/sbin/nologin
/* --------------------- */
--------------------------
8 Answer Below:
--------------------------
/* --------------------- */
Explanation: System accounts usually have no valid login shell or have /sbin/nologin, as stated in the note. Option a) is incorrect because it is the default shell for regular user accounts, not system accounts. Option c) is also incorrect because it is not commonly used as the login shell for system accounts. Option d) is similar to the correct answer, but it is less commonly used than /sbin/nologin.
8. Answer: b) /sbin/nologin
9. Do system accounts usually have a dedicated home directory under /home?
a) Yes
b) No
/* --------------------- */
--------------------------
9 Answer Below:
--------------------------
/* --------------------- */
Explanation: System accounts either have no dedicated home directory or a directory that is usually not under /home, as stated in the note. Option a) is incorrect because it implies that system accounts always have a dedicated home directory under /home, which is not true.
9. Answer: b) No
10. Can system accounts login to the system?
a) Yes
b) No
/* --------------------- */
--------------------------
10 Answer Below:
--------------------------
/* --------------------- */
Explanation: Most system accounts on Linux will never login, as stated in the note. Therefore, system accounts cannot login to the system. Option a) is incorrect because it implies that system accounts can login to the system, which is not true.
10. Answer: b) No
11. What is the primary purpose of system accounts?
a) To provide superuser access to the system
b) To run facilities, programs and services that will not run as the superuser
c) To provide login access to regular users
d) To manage file permissions on the system
/* --------------------- */
--------------------------
11 Answer Below:
--------------------------
/* --------------------- */
Explanation: The primary purpose of system accounts is to provide a separate identity for facilities, programs and services that will not run as the superuser, as stated in the note. Option a) is incorrect because superuser access is provided by the root account, not system accounts. Option c) is also incorrect because regular users have their own user accounts for login access. Option d) is unrelated to the purpose of system accounts.
11. Answer: b) To run facilities, programs and services that will not run as the superuser