Practice Free 102-500 Exam Online Questions
Which of the following entries in /etc/syslog.conf writes all mail related events to the file /var/log/maillog and sends all critical events to the remote server logger.example.com?
- A . mail.*/var/log/maillogmail,[email protected]
- B . mail.*/var/log/maillogmail.critsyslog://logger.example.org
- C . mail/var/log/[email protected]
- D . mail.*/var/log/[email protected]
- E . mail */var/log/maillogmail [email protected]
D
Explanation:
The /etc/syslog.conf file is used to configure the syslog daemon, which handles the logging of system messages. The file consists of lines that have the following format: selector action. The selector specifies the type and priority of the messages to be logged, and the action specifies what to do with the messages. The selector has two parts, separated by a dot: the facility and the priority. The facility indicates the source of the message, such as mail, auth, kern, etc. The priority indicates the severity of the message, such as emerg, alert, crit, err, etc. A priority can also be preceded by an equal sign (=) to match only that priority, or a minus sign (-) to match all priorities except that one.
The action can be one of the following:
A filename, starting with a slash (/), indicating the file to write the messages to.
A hostname, preceded by an at sign (@), indicating the remote host to send the messages to via UDP.
A username, indicating the user to send the messages to via wall.
An asterisk (*), indicating all logged-in users.
A pipe symbol (|), followed by a command, indicating the program to pipe the messages to.
In this question, the correct entry is
D. mail.*/var/log/[email protected]. This entry means:
Log all mail related messages (mail.*) to the file /var/log/maillog.
Log all critical mail messages (mail.crit) to the remote host logger.example.org.
The other options are incorrect because:
Option A is missing a dot between mail and crit, and uses the wrong domain name (example.org instead of example.com).
Option B uses an invalid action (syslog://logger.example.org) that is not supported by syslog.conf.
Option C is missing a dot between mail and *.
Option E is missing dots between mail and * and between mail and crit.
Reference: [LPI 102-500 Exam Objectives], Topic 106.1: Maintain system time, Weight: 3. [LPI Linux
Essentials Study Guide], Chapter 9: Administrative Tasks, Section 9.4: System Logging.
What is the purpose of TCP wrapper?
- A . Manage and adjust bandwidth used by TCP services.
- B . Bind a network service to a TCP port.
- C . Encapsulate TCP messages in IP packets.
- D . Add SSL support to plain text TCP services.
- E . Limit access to a network service.
E
Explanation:
TCP wrapper is a security tool that allows you to restrict the access to a network service based on the source IP address or hostname of the client. TCP wrapper works by intercepting the incoming connection requests to a service and checking them against a set of rules defined in the /etc/hosts.allow and /etc/hosts.deny files. If the client is allowed, the connection is passed to the service. If the client is denied, the connection is rejected and an error message is logged.
Reference: LPI Linux Essentials: 1.5 Security and File Permissions: 1.5.3 Network Security LPIC-1: System Administrator: 102.5 Implement basic network security: 102.5.1 TCP Wrappers
The correct crontab entry to execute the script chklog three times per month between 3 p.m. and 5 p.m.:
- A . * 3,4,5 1 * * chklog
- B . 3 3,4,5 1 * * chklog
- C . 3 15,16,17 * * * chklog
- D . 0 15,16,17 1 * * chklog
- E . * 15,16,17 1 * * chklog
C
Explanation:
The correct crontab entry to execute the script chklog three times per month between 3 p.m. and 5 p.m. is:
3 15,16,17 * * * chklog
The crontab entry has five fields that specify the time and frequency of the job, followed by the command or script to be executed.
The fields are:
Minute: the minute of the hour when the job should run, from 0 to 59
Hour: the hour of the day when the job should run, from 0 to 23 (in 24-hour format)
Day of month: the day of the month when the job should run, from 1 to 31
Month: the month of the year when the job should run, from 1 to 12
Day of week: the day of the week when the job should run, from 0 to 6 (where 0 and 7 are Sunday) The asterisk (*) means any value, and the comma (,) means a list of values.
Therefore, the crontab entry above means:
Run the job at the 3rd minute of the hour
Run the job at the 15th, 16th, and 17th hour of the day (which are 3 p.m., 4 p.m., and 5 p.m.)
Run the job on any day of the month
Run the job on any month of the year
Run the job on any day of the week
This will execute the script chklog three times per day, every day of the month, and every month of the year, which is equivalent to three times per month. The other options are incorrect because:
On a system running the KDE Display Manager, when is the /etc/kde4/kdm/Xreset script automatically executed?
- A . When KDM starts
- B . When a user’s X session exits
- C . When KDM crashes
- D . When X is restarted
- E . When X crashes
B
Explanation:
The /etc/kde4/kdm/Xreset script is a script that runs as root after a user’s X session exits. It can be used to perform some cleanup tasks or other actions that need to be done when the user logs out of the graphical environment. For example, it can reassign the ownership of the console to root, or shut down the system if desired. The /etc/kde4/kdm/Xreset script is part of the KDE Display Manager (kdm), which is a graphical login manager for X. KDM can be configured to run this script by setting the Reset key in the [X-*-Core] section of the /etc/kde4/kdm/kdmrc configuration file.
Reference: kdm.options – configuration options for X display manager
kdm(1) ― kdm ― Debian jessie ― Debian Manpages debian – How to get system to shutdown when Xorg is quit? – Unix …
Which of the following files assigns a user to its primary group?
- A . /etc/pgroup
- B . /etc/shadow
- C . /etc/group
- D . /etc/passwd
- E . /etc/gshadow
D
Explanation:
The /etc/passwd file assigns a user to its primary group by specifying the group ID (GID) of the primary group in the fourth field of each line. The /etc/passwd file contains the basic information for each user account on a Linux system, such as the user name, user ID (UID), group ID (GID), home directory, login shell, etc. The format of each line is: username:password:UID:GID:comment:home:shell
For example, the following line assigns the user bob to the primary group bob, which has the GID of
1001:
bob:x:1001:1001::/home/bob:/bin/sh
The /etc/passwd file can be viewed and modified by the root user or by using the useradd, usermod, or userdel commands123. The other files listed in the options do not assign a user to its primary group. The /etc/pgroup file does not exist by default on most Linux systems, and it is not related to the primary group. The /etc/shadow file contains the encrypted passwords and other information for each user account, but not the primary group4. The /etc/group file contains the information for each group on the system, such as the group name, group password, group ID, and group members, but not the primary group of each user5. The /etc/gshadow file contains the encrypted passwords for group accounts.
Reference: 12345
What is a purpose of an SSH host key?
- A . It must be sent by any SSH client in addition to a user key in order to identify the client’s host.
- B . It provides the server’s identity information to connecting SSH clients.
- C . It is the root key by which all user SSH keys must be signed.
- D . It authenticates any user that logs into a remote machine from the key’s host.
- E . It is used by system services like cron, syslog or a backup job to automatically connect to remote hosts.
B
Explanation:
An SSH host key is a cryptographic key used for authenticating computers in the SSH protocol. Host keys are key pairs, typically using the RSA, DSA, or ECDSA algorithms. Public host keys are stored on and/or distributed to SSH clients, and private keys are stored on SSH servers. Each host (i.e., computer) should have a unique host key. Host keys are used for authentication towards the connecting client, analogous to user SSH keys. Host keys are generated using asymmetric encryption algorithms like RSA, DSA, or ECDSA algorithms12. When a client connects to the host, the host sends its public host key to the client, and the client verifies that the host key matches the one stored in its known hosts file. If the host key is unknown or has changed, the client will display a warning and prompt the user to accept or reject the host key. This is to prevent man-in-the-middle attacks, where an attacker intercepts the connection and pretends to be the legitimate host. The other options are either incorrect or irrelevant to the purpose of an SSH host key.
Reference: What is an SSH Host Key & How are They Configured?, What are SSH Host Keys? section
SSH Host Key Management Demystified, What are SSH host keys? section
What is SSH host key – omnisecu.com, first paragraph
Which environment variable should be set in order to change the time zone for the commands run from within the environment variable’s scope? (Specify the variable name only.)
Explanation:
The TZ environment variable is used to change the time zone for the commands run from within the environment variable’s scope. It specifies the name of a time zone as defined in the /usr/share/zoneinfo directory or a custom time zone in the POSIX format12. The TZ variable can be set either globally in a shell profile file or locally in a shell session. For example, to set the time zone to America/New_York for the current shell session, one can use the following command: export TZ=America/New_York
To verify the change, one can use the date command to display the current date and time according to the TZ variable. The TZ variable can also be used to run a single command with a different time zone without affecting the system’s time zone. For example, to run the date command with the Asia/Tokyo time zone, one can use the following syntax: TZ=Asia/Tokyo date
The TZ variable is useful for testing how applications behave in different time zones or for displaying the time in different locations34.
Reference: How to Set or Change the Time Zone in Linux | Linuxize
Linux / UNIX: TZ Environment Variable – nixCraft
Get Current System Time Zone in Linux | Baeldung on Linux
Setting the TZ Environment Variable on Linux | InterSystems Developer
Which of the following commands shows all active systemd timers?
- A . systemctl-timer show
- B . timectl list
- C . systemctl Ct
- D . systemctl list-timers
- E . timeq
D
Explanation:
The command systemctl list-timers shows all active systemd timers, which are units that can be used
to schedule the execution of other units at specific times or after certain intervals.
The output of the command includes the following columns:
NEXT: The next time the timer will trigger.
LEFT: The time left until the next trigger.
LAST: The last time the timer triggered.
PASSED: The time passed since the last trigger.
UNIT: The name of the timer unit.
ACTIVATES: The name of the unit that is activated by the timer.
For example, the following output shows two active timers: apt-daily.timer and apt-daily-upgrade.timer, which are used to perform automatic updates on Debian-based systems.
NEXT LEFT LAST PASSED UNIT ACTIVATES Mon 2021-11-15 06:00:00 UTC 9h left Sun 2021-11-14 06:00:01 UTC 20h ago apt-daily.timer apt-daily.service Mon 2021-11-15 06:23:51 UTC 9h left Sun 2021-11-14 06:23:51 UTC 20h ago apt-daily-upgrade.timer apt-daily-upgrade.service 2 timers listed. The other commands in the options are either invalid or unrelated to systemd timers: systemctl-timer show is not a valid command. To show the details of a specific timer unit, the command systemctl show unit.timer can be used, where unit is the name of the unit that is activated by the timer.
timectl list is not a valid command. To list the available time zones, the command timedatectl list-
timezones can be used. To list the current time and date settings, the command timedatectl can be
used without any arguments.
systemctl -t is not a complete command. To list all units of a specific type, the command systemctl -t
type can be used, where type is the name of the unit type, such as service, timer, socket, etc.
timeq is not a valid command. It may be confused with the time command, which measures the time
taken by a command or program to execute.
Reference: LPIC-1 Exam 102 Objectives, Topic 107: Administrative Tasks, Subtopic 107.2: Automate system administration tasks by scheduling jobs, Weight: 4, Key Knowledge Areas: Use cron and systemd timers to run jobs at regular intervals and to use anacron to manage system cron jobs. Objective: Use systemd timers to run jobs at regular intervals and to use anacron to manage system cron jobs. LPIC-1 Exam 102 Learning Materials, Topic 107: Administrative Tasks, Subtopic 107.2: Automate
system administration tasks by scheduling jobs, Section 107.2.3: systemd timers, Page 21-22.
What is the top-level directory which contains the configuration files for CUPS? (Specify the full path to the directory.)
cups-files.conf
Explanation:
The top-level directory which contains the configuration files for CUPS is /etc/cups. CUPS stands for
Common UNIX Printing System, which is the printer and print job manager for Linux. The /etc/cups directory contains several configuration files related to CUPS, such as cupsd.conf, which is the main configuration file for the cupsd print server daemon, and printers.conf, which contains the definition of the printers. The /etc/cups directory is part of the topic 108.4: Manage printers and printing, which is one of the objectives of the LPI Linux Administrator – 102 exam12.
Reference: 1: LPI Linux Administrator – 102 (LPIC-1) 2: Exam 102 Objectives
Which configuration file contains the default options for SSH clients?
- A . /etc/ssh/sshd_config
- B . /etc/ssh/ssh
- C . /etc/ssh/ssh_config
- D . /etc/ssh/client
- E . /etc/ssh/ssh_client
C
Explanation:
The configuration file that contains the default options for SSH clients is /etc/ssh/ssh_config. This file is read by the ssh program when it connects to a remote SSH server. It can contain global options that apply to all hosts, or host-specific options that only apply to certain hosts or patterns. The /etc/ssh/ssh_config file is the system-wide default SSH client configuration file. It can be overridden by a user-specific configuration file ~/.ssh/config, which is located in the user’s home directory. The /etc/ssh/ssh_config file is part of the topic 110.1: Perform security administration tasks, which is one of the objectives of the LPI Linux Administrator – 102 exam12.
Reference: 1: LPI Linux Administrator – 102 (LPIC-1) 2: Exam 102 Objectives