Prepare for the LPIC-1 System Administrator Exam 102, Part 2 of 2, (version 5.0) exam with our extensive collection of questions and answers. These practice Q&A are updated according to the latest syllabus, providing you with the tools needed to review and test your knowledge.
QA4Exam focus on the latest syllabus and exam objectives, our practice Q&A are designed to help you identify key topics and solidify your understanding. By focusing on the core curriculum, These Questions & Answers helps you cover all the essential topics, ensuring you're well-prepared for every section of the exam. Each question comes with a detailed explanation, offering valuable insights and helping you to learn from your mistakes. Whether you're looking to assess your progress or dive deeper into complex topics, our updated Q&A will provide the support you need to confidently approach the LPI 102-500 exam and achieve success.
Which file lists which users can execute commands using sudo? (Specify the full name of the file, including path.)
The /etc/sudoers file lists which users can execute commands using sudo, as well as which commands they can run, on which hosts, and as which users. The /etc/sudoers file is the main configuration file for the sudo command, which allows users to run commands as another user, usually the superuser or root. The /etc/sudoers file has a specific syntax and should be edited only with the visudo command, which checks the file for errors and locks it to prevent concurrent edits. The /etc/sudoers file contains entries that follow the format:
user host = (runas) command
where user is the name of the user who can run sudo, host is the name of the host where the user can run sudo, runas is the name of the user as whom the command will be executed, and command is the name of the command or a list of commands that the user can run with sudo. For example, the entry:
alice ALL = (root) /bin/ls, /usr/bin/whoami
means that the user alice can run sudo on any host, and can execute the commands /bin/ls and /usr/bin/whoami as the root user. The /etc/sudoers file also supports aliases, variables, wildcards, and other features that make it more flexible and powerful. For more details, see the sudoers manual page.
LPIC-1 Exam 102 Objectives, Topic 110: Security, Subtopic 110.2: Use sudo to manage access to the root account, Weight: 2, Key Knowledge Areas: Configure sudo and sudoers. Use sudo to execute commands as another user.
LPIC-1 Exam 102 Learning Materials, Topic 110: Security, Subtopic 110.2: Use sudo to manage access to the root account, Section 110.2.1: sudo and sudoers, Page 3-5.
Which of the following environment variables can be defined in locale. conf ? (Choose TWO correct answers.)
After issuing:
function myfunction { echo $1 $2 ; }
in Bash, which output does:
myfunction A B C
Produce?
In Bash, a function is a block of code that can be invoked by its name. A function can take arguments, which are passed to the function as positional parameters. The$1variable refers to the first argument,$2to the second argument, and so on. The function can access the number of arguments passed to it by using the$#variable. In this case, the functionmyfunctionsimply echoes the first and second arguments to the standard output. Therefore, when the commandmyfunction A B Cis executed, the output isA B, since the third argumentCis ignored by the function.Reference:
[LPI Linux Essentials - Topic 103: Command Line Basics]
[Bash Functions]
Which command allows you to make a shell variable visible to subshells?
The command that allows you to make a shell variable visible to subshells isexport VARIABLE. This command turns the variable into a global or environment variable, which means it can be accessed by any child process or subshell that inherits the environment of the parent shell. The syntax of the export command does not require a dollar sign ($) before the variable name, unlike when referencing the value of the variable. The other commands are either invalid or do not affect the visibility of the variable to subshells. Thesetcommand can be used to assign values to variables, but it does not export them. Theenvcommand can be used to run a command in a modified environment, but it does not change the environment of the current shell.Reference:
[LPI Linux Essentials - Topic 105: Shells, Scripting and Data Management]
[LPI Linux Professional - Exam 102 Objectives - Topic 105: Shells and Shell Scripting]
What is a Subshell? - Linux Bash Shell Scripting Tutorial Wiki - nixCraft
What is Subshell in Linux? [Explained]
What is true regarding the file ~/.forward?
The file ~/.forward is a text file that contains one or more email addresses to which the incoming mail for the user will be forwarded123.The file is owned by the user and can be edited with any text editor123.The file does not require any special syntax or commands, just a list of email addresses separated by commas or newlines123. For example, if the user wants to forward their mail to alice@example.com and bob@example.com, they can create a ~/.forward file with the following content:
alice@example.com, bob@example.com
The MTA will read the ~/.forward file and send a copy of each incoming mail to the specified addresses123. Therefore, the correct answer is D. When configured correctly, ~/.forward can be used to forward each incoming mail to more than one other recipient.
The other options are false regarding the file ~/.forward.The file is not owned by the MTA and does not need to be edited with the editaliases command, which is used to edit the system-wide aliases file, not the user-specific ~/.forward file4.The user does not need to run newaliases to make the MTA aware of the changes, as the MTA will check the ~/.forward file every time a mail is delivered to the user123.The newaliases command is used to rebuild the system-wide aliases database, not the user-specific ~/.forward file4.The file ~/.forward does not have any restrictions on the email addresses that can be used for forwarding, as long as they are valid and reachable123. The root user can also use the ~/.forward file to forward their mail, but it is not recommended for security reasons.
Full Exam Access, Actual Exam Questions, Validated Answers, Anytime Anywhere, No Download Limits, No Practice Limits
Get All 234 Questions & Answers