Practice Free 102-500 Exam Online Questions
After adding a new email alias to the configuration, which command must be run in order to ensure the MTA knows about it? (Specify the command without any path but including all required parameters.)
sendmail -bi
Explanation:
The command that must be run in order to ensure the MTA knows about the new email alias is:
newaliases
This command updates the MTA’s aliases database and makes the changes effective. It is equivalent to the commands sendmail -bi or sendmail -I12. The newaliases command should be run after making modifications to the /etc/aliases file, which contains the email aliases for the system3.
Why is the correct configuration of a system’s time zone important?
- A . Because the conversion of Unix timestamps to local time relies on the time zone configuration.
- B . Because the time zone is saved as part of the modification times of files and cannot be changed after a file is created.
- C . Because the environment variables LANG and LC_MESSAGES are, by default, set according to the time zone.
- D . Because NTP chooses servers nearby based on the configured time zone.
A
Explanation:
The correct configuration of a system’s time zone is important because it affects how the system displays and interprets the local time from the Unix timestamps. A Unix timestamp is a number that represents the number of seconds that have elapsed since January 1, 1970 (UTC)1. Unix timestamps are independent of time zones and are the same for all systems1. However, when a system needs to display or interpret the local time from a Unix timestamp, it needs to know the offset from UTC, which is determined by the time zone configuration23. If the time zone configuration is incorrect, the system may display or interpret the local time incorrectly, which can cause problems with scheduling tasks, logs, and other applications45.
For example, suppose a system has a Unix timestamp of 1638374400, which corresponds to December 1, 2021, 12:00:00 UTC6. If the system’s time zone is configured correctly as UTC, it will display the local time as December 1, 2021, 12:00:00. However, if the system’s time zone is configured incorrectly as EST (Eastern Standard Time), which is 5 hours behind UTC, it will display the local time as December 1, 2021, 07:00:00, which is 5 hours earlier than the actual local time6. This can lead to confusion and errors for the system and the user.
Therefore, the correct answer is
Which command included in systemd supports selecting messages from the systemd journal by criteria such as time or unit name? (Specify only the command without any path or parameters.)
Explanation:
The command journalctl is included in systemd and supports selecting messages from the system journal by criteria such as time or unit name. The systemd journal is a binary log file that stores system and service messages. The journalctl command can be used to view, filter, export, and manipulate the journal entries. For example, to show all messages from a specific unit, such as sshd.service, the command would be:
journalctl -u sshd.service
To show all messages from a specific time range, such as yesterday, the command would be:
journalctl –since=yesterday
The journalctl command has many options and arguments that can be used to customize the output and perform various operations on the journal. For more information, see the man page of journalctl or the official documentation1.
Reference: [LPI 102-500 Exam Objectives], Topic 106.2: System logging, Weight: 3. [systemd-journald.service(8) ― systemd ― Debian unstable ― Debian Manpages], Section NAME.
Which of the following comparison operators for test work on elements in the file system? (Choose two.)
- A . Cz
- B . Ceq
- C . Cd
- D . Cf
- E . Clt
C,D
Explanation:
The comparison operators for test that work on elements in the file system are -d and -f. The -d operator tests if a given file name refers to a directory, and returns true if it does. The -f operator tests if a given file name refers to a regular file, and returns true if it does. These operators are part of the topic 105.3: Perform basic file management, 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 file is processed by newaliases? (Specify the full name of the file, including path.)
Which directory holds the files that configure the xinetd service when using several configuration files instead of an integrated configuration file? (Specify the full path to the directory.)
/etc/xinetd.d
Explanation:
The /etc/xinetd.d/ directory holds the files that configure the xinetd service when using several configuration files instead of an integrated configuration file. Each file in this directory corresponds to a specific service that is managed by xinetd, such as telnet, ftp, ssh, etc. The name of the file matches the name of the service. The files in this directory contain service-specific options that override or supplement the global options defined in the /etc/xinetd.conf file. The files are read only when the xinetd service is started, so any changes require a restart of the service. The /etc/xinetd.d/ directory allows for a modular and flexible configuration of the xinetd service, as well as easier management and maintenance of the individual service files.
Reference: How to configure xinetd ? – Red Hat Customer Portal
Understanding /etc/xinetd.d directory under Linux
xinetd – Wikipedia
Which of the following statements is valid in the file /etc/nsswitch.conf?
- A . multi on
- B . 192.168.168.4 dns-server
- C . hosts: files dns
- D . include /etc/nsswitch.d/
C
Explanation:
The statement hosts: files dns is valid in the file /etc/nsswitch.conf. It means that the system will use the local /etc/hosts file and the Domain Name System (DNS) to resolve host names to IP addresses. The order of the sources on the line determines the order in which they will be queried. In this case, the system will first check the /etc/hosts file for a matching host name, and if not found, it will query the DNS servers configured in /etc/resolv.conf. The other statements in the question are not valid in the /etc/nsswitch.conf file. The statement multi on is not a valid keyword or source for any database. The statement 192.168.168.4 dns-server is not a valid syntax for specifying a source or an action. The statement include /etc/nsswitch.d/ is not a valid way to include another file or directory in the /etc/nsswitch.conf file.
Reference: [LPI Linux Administrator – Exam 102 Objectives – Topic 109: Networking Fundamentals] nsswitch.conf(5) – Linux manual page
What is the /etc/nsswitch.conf file in Linux C TecAdmin
By default, the contents of which directory will be copied to a new user’s home directory when the account is created by passing the -m option to the useradd command? (Specify the full path to the directory.)
Explanation:
The /etc/skel directory contains files and directories that are used as a template for creating a new user’s home directory. The useradd command uses the -m (or –create-home) option to create the user home directory as /home/username and copy the files from /etc/skel to it. The files in /etc/skel are typically initialization files such as .bashrc, .profile, and .bash_logout that set the user’s environment variables, aliases, and other preferences. The system administrator can customize the /etc/skel directory to provide a consistent and convenient initial setup for new users.
Reference: https://www.howtouselinux.com/post/create-new-user-with-home-directory-in-linux
https://linuxize.com/post/how-to-create-users-in-linux-using-the-useradd-command/
What command will display the group names and GIDs to which a user belongs? (Provide only the command name with or without path information)
Explanation:
The id command will display the user ID (uid), the primary group ID (gid), and the supplementary groups (groups) of a user. The output will show the names and the numerical IDs of the groups.
For example:
id linuxize
The command will show the user ID (uid), the user’s primary group (gid), and the user’s secondary groups (groups)
uid=1001(linuxize) gid=1001(linuxize) groups=1001(linuxize),27(sudo) To print only the names instead of the numbers use the -n option. id -nG linuxize
The command will show only the names of the groups
linuxize sudo
The id command is part of the GNU coreutils package and is available on all Linux systems. The full path of the command is /usr/bin/id.
Reference: id(1) – Linux manual page
How to List Groups in Linux | Linuxize
Which of the following details is NOT provided in any output from the netstat utility?
- A . broadcast services
- B . interface statistics
- C . masquerading connections
- D . network connections
- E . routing tables
A
Explanation:
The netstat utility is a command-line tool that displays network connections, routing tables, interface statistics, masquerade connections, and multicast memberships. It can be used with various options to filter and customize the output. However, it does not provide any information about broadcast services, which are a type of network communication that sends data to all devices on a network segment. Broadcast services are usually handled by other tools, such as ping, traceroute, or arp.
Reference: netstat | Microsoft Learn
28 Netstat Commands {A Comprehensive List With Examples} – phoenixNAP