최신 LFCS 무료덤프 - Linux Foundation Certified System Administrator
Which of the following tasks can be accomplished using the command date? (Choose TWO correct answers.)
정답: B,C
Task
The system service apache2 is failing to start.
First, troubleshoot the failure and fix it.
Finally, start the systemd service and ensure it is running.
The system service apache2 is failing to start.
First, troubleshoot the failure and fix it.
Finally, start the systemd service and ensure it is running.
정답:
See the complete solution in Explanation.
Explanation:
Step 1: Connect to the correct Linux server.
The video specifies that this task must be performed on host lfcs00101a.
From the candidate terminal, execute:
ssh lfcs00101a
This establishes an SSH session with the server where the Apache service is failing.
All subsequent troubleshooting, configuration changes, and service operations must be performed on this host.
Step 2: Check the current status of the Apache service.
Execute:
sudo systemctl status apache2
This is the primary systemd command for checking the status of Apache.
It displays information such as:
* Whether the apache2 service is loaded.
* Whether the service is running, inactive or failed.
* The process ID and execution status.
* Recent service log messages.
* Errors reported during startup.
An illustrative failure might appear as follows:
× apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled)
Active: failed (Result: exit-code)
Process: 1234 ExecStart=/usr/sbin/apachectl start
Main PID: 1234 (code=exited, status=1/FAILURE)
This is an example, not an output confirmed from the supplied video.
The Active: failed status means the service was unable to complete startup successfully.
Use the actual error messages to determine the cause.
Step 3: Examine the Apache service logs.
Execute:
sudo journalctl -u apache2 -b --no-pager
* journalctl displays logs collected by systemd.
* -u apache2 filters messages associated with the Apache service.
* -b restricts results to the current boot.
* --no-pager prints output directly without opening an interactive pager.
To display only the latest 50 messages:
sudo journalctl -u apache2 -n 50 --no-pager
These logs help identify why Apache failed.
Possible causes include:
* Incorrect permissions on the Apache executable.
* Invalid configuration directives.
* Missing configuration files.
* Another process using the required network port.
* Inaccessible log directories.
* Missing modules or other dependencies.
The official systemd documentation supports using journalctl -u to investigate the logs associated with a particular service.
Freedesktop
Step 4: Check the Apache executable.
On Ubuntu, the Apache server executable is normally located at:
/usr/sbin/apache2
Verify its existence:
ls -l /usr/sbin/apache2
For a more detailed permissions check:
stat -c '%A %a %U:%G %n' /usr/sbin/apache2
A correctly installed executable would typically have permissions similar to:
-rwxr-xr-x 755 root:root /usr/sbin/apache2
The x characters represent execute permission.
For example, if the permissions were incorrectly changed to:
-rw-r--r--
the executable would lack execution permission.
This can prevent Apache from starting successfully.
Step 5: Inspect the complete path permissions.
Execute:
namei -l /usr/sbin/apache2
This examines the permission bits and ownership of each directory component leading to the executable.
It helps distinguish between:
* A non-executable Apache binary.
* A directory that lacks search permission.
* Incorrect ownership or permissions elsewhere in the path.
Also verify which package owns the executable:
dpkg -S /usr/sbin/apache2
On Ubuntu, it normally belongs to the apache2-bin package.
If required, check package-file integrity:
sudo dpkg -V apache2-bin
Package verification can help identify unexpectedly modified permissions or file contents.
Step 6: Correct the executable permission if it is the source of the failure.
In the supplied video, the candidate executes:
sudo chmod +x /usr/sbin/apache2
This is an important observation.
The command adds execute permission to the Apache executable according to the applicable chmod rules.
However, the candidate does not visibly demonstrate the earlier diagnostic output proving that missing execute permission caused the failure.
If the executable genuinely lacks its required execute permission, restore its expected mode:
sudo chmod 755 /usr/sbin/apache2
* chmod changes file permissions.
* 755 grants read, write and execute permissions to the owner.
* 755 grants read and execute permissions to the group.
* 755 grants read and execute permissions to other users.
This is appropriate for a standard root-owned Apache executable when its mode has been incorrectly changed.
Do not execute this as a universal fix if the actual failure is a configuration error or port conflict.
Step 7: Verify the corrected permissions.
Execute:
ls -l /usr/sbin/apache2
Expected permissions, assuming the standard installation:
-rwxr-xr-x
For numerical verification:
stat -c '%a %n' /usr/sbin/apache2
Expected:
755 /usr/sbin/apache2
If the file's ownership is also incorrect, compare it with the package's expected ownership before making additional changes.
Step 8: Check the Apache configuration syntax.
Execute:
sudo apache2ctl configtest
This checks the Apache configuration for syntax errors.
For a valid configuration, the expected output is:
Syntax OK
The Apache control utility supports the configtest operation specifically for validating configuration syntax.
Apache HTTP Server Version 2.4
If it reports an error, inspect the identified file and line.
For example, an illustrative error might be:
Syntax error on line 42 of /etc/apache2/apache2.conf
Invalid command 'InvalidDirective'
In that case, correct the configuration directive instead of modifying executable permissions.
A successful syntax check does not guarantee that Apache can start, but it eliminates many configuration- related problems.
Step 9: Check whether Apache's required network ports are available.
Apache commonly listens on TCP port 80 for HTTP and port 443 for HTTPS.
Execute:
sudo ss -ltnp
To examine those ports specifically:
sudo ss -ltnp | grep -E ':(80|443)\b'
If another service already occupies a port configured for Apache, startup may fail with an address-binding error.
The official Apache documentation identifies port-binding conflicts as a common startup failure.
Apache HTTP Server Version 2.4
Do not stop another service unless the diagnostic evidence establishes that it is the source of the problem and the change is appropriate.
Step 10: Check Apache's own error log if necessary.
Execute:
sudo tail -n 50 /var/log/apache2/error.log
This displays recent entries from the standard Ubuntu Apache error log.
The file may contain additional details not included in the systemd journal.
Look for permission errors, configuration failures, missing resources or binding errors.
If the executable-permission repair was the only required correction, there may be no additional configuration changes to make.
Step 11: Start the Apache service.
After correcting the identified problem, execute:
sudo systemctl start apache2
* sudo provides administrative privileges.
* systemctl manages systemd services.
* start requests that the specified service begin running.
* apache2 identifies the Apache service unit.
This command directly satisfies the task's instruction to start the systemd service.
In the video, the candidate uses:
sudo systemctl restart apache2
The restart operation stops and starts an active service or starts it when appropriate.
Either operation can result in Apache running, but systemctl start apache2 is the more direct choice when the service is currently stopped or failed.
Step 12: Verify that Apache is running.
Execute:
sudo systemctl status apache2
Expected successful status:
# apache2.service - The Apache HTTP Server
Loaded: loaded
Active: active (running)
The critical field is:
Active: active (running)
This indicates that systemd considers the service active.
The official systemctl documentation defines the status command as the way to inspect the current runtime state of a service unit.
Linux manual page
Step 13: Verify the active service state directly.
Execute:
systemctl is-active apache2
Expected output:
active
Check the exit status immediately afterward:
echo $?
Expected:
0
The service is considered active when systemctl is-active returns active with a successful exit status.
Step 14: Verify that Apache is listening for connections.
Execute:
sudo ss -ltnp | grep apache2
This should display Apache processes listening on the ports specified in its configuration, provided those sockets can be associated with the process in the command output.
Alternatively, check the configured HTTP port:
sudo ss -ltnp | grep ':80'
An illustrative successful result might include:
LISTEN 0 511 0.0.0.0:80 0.0.0.0:*
The actual listening address and ports depend on Apache's configuration.
Step 15: Test the Apache HTTP service.
Execute:
curl
-I http://localhost
This sends an HTTP HEAD request to the local web server.
An example of a successful HTTP response is:
HTTP/1.1 200 OK
Server: Apache/2.4.x (Ubuntu)
Content-Type: text/html
The exact response code depends on the website's configuration. For example, a redirect or authentication response can still show that Apache is accepting connections.
If the service is active but HTTP requests fail, inspect its listener configuration and logs.
Step 16: Confirm that the service remains running.
Execute:
sleep 5
systemctl is-active apache2
Expected:
active
This additional check helps detect a service that starts briefly and then fails.
You can also inspect recent logs:
sudo journalctl -u apache2 -n 20 --no-pager
Confirm that no further startup or runtime failures have occurred.
Step 17: Perform final verification.
Execute:
sudo apache2ctl configtest
systemctl is-active apache2
sudo systemctl status apache2 --no-pager
curl
-I http://localhost
The final requirements are:
Verification
Expected result
Apache configuration test
Syntax OK
Apache executable permission
Valid executable permissions
systemd service status
active (running)
HTTP connectivity
A valid response from the configured service
Original startup failure
Resolved
Final Solution
The video suggests the failure may be related to execute permission on /usr/sbin/apache2. The following is the concise command sequence for that specific confirmed failure.
1. Connect to the server.
ssh lfcs00101a
2. Check the service failure.
sudo systemctl status apache2
sudo journalctl -u apache2 -n 50 --no-pager
3. Inspect the Apache executable permissions.
ls -l /usr/sbin/apache2
4. Restore executable permissions if they are incorrect.
sudo chmod 755 /usr/sbin/apache2
5. Validate the Apache configuration.
sudo apache2ctl configtest
6. Start the Apache service.
sudo systemctl start apache2
7. Verify the running service.
sudo systemctl status apache2
systemctl is-active apache2
Expected:
active
8. Verify HTTP connectivity.
curl
-I http://localhost
Technical Verification and References
The procedures are consistent with official Apache and systemd documentation:
* Apache HTTP Server - apachectl and configtest
* Apache HTTP Server - Startup and Troubleshooting
* Linux systemctl - Managing Service Units
* systemd journalctl - Service Log Inspection
Expected result: The cause preventing apache2 from starting is corrected, and the service is successfully started with systemd and remains in the active (running) state.
Video verification finding: The candidate visibly runs sudo chmod +x /usr/sbin/apache2 and then attempts to restart Apache. That is a valid repair if missing executable permission was the actual fault, but the visible commands do not independently prove the diagnosis or final service state. The diagnostic and verification steps above are necessary for a reliable solution.
Explanation:
Step 1: Connect to the correct Linux server.
The video specifies that this task must be performed on host lfcs00101a.
From the candidate terminal, execute:
ssh lfcs00101a
This establishes an SSH session with the server where the Apache service is failing.
All subsequent troubleshooting, configuration changes, and service operations must be performed on this host.
Step 2: Check the current status of the Apache service.
Execute:
sudo systemctl status apache2
This is the primary systemd command for checking the status of Apache.
It displays information such as:
* Whether the apache2 service is loaded.
* Whether the service is running, inactive or failed.
* The process ID and execution status.
* Recent service log messages.
* Errors reported during startup.
An illustrative failure might appear as follows:
× apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled)
Active: failed (Result: exit-code)
Process: 1234 ExecStart=/usr/sbin/apachectl start
Main PID: 1234 (code=exited, status=1/FAILURE)
This is an example, not an output confirmed from the supplied video.
The Active: failed status means the service was unable to complete startup successfully.
Use the actual error messages to determine the cause.
Step 3: Examine the Apache service logs.
Execute:
sudo journalctl -u apache2 -b --no-pager
* journalctl displays logs collected by systemd.
* -u apache2 filters messages associated with the Apache service.
* -b restricts results to the current boot.
* --no-pager prints output directly without opening an interactive pager.
To display only the latest 50 messages:
sudo journalctl -u apache2 -n 50 --no-pager
These logs help identify why Apache failed.
Possible causes include:
* Incorrect permissions on the Apache executable.
* Invalid configuration directives.
* Missing configuration files.
* Another process using the required network port.
* Inaccessible log directories.
* Missing modules or other dependencies.
The official systemd documentation supports using journalctl -u to investigate the logs associated with a particular service.
Freedesktop
Step 4: Check the Apache executable.
On Ubuntu, the Apache server executable is normally located at:
/usr/sbin/apache2
Verify its existence:
ls -l /usr/sbin/apache2
For a more detailed permissions check:
stat -c '%A %a %U:%G %n' /usr/sbin/apache2
A correctly installed executable would typically have permissions similar to:
-rwxr-xr-x 755 root:root /usr/sbin/apache2
The x characters represent execute permission.
For example, if the permissions were incorrectly changed to:
-rw-r--r--
the executable would lack execution permission.
This can prevent Apache from starting successfully.
Step 5: Inspect the complete path permissions.
Execute:
namei -l /usr/sbin/apache2
This examines the permission bits and ownership of each directory component leading to the executable.
It helps distinguish between:
* A non-executable Apache binary.
* A directory that lacks search permission.
* Incorrect ownership or permissions elsewhere in the path.
Also verify which package owns the executable:
dpkg -S /usr/sbin/apache2
On Ubuntu, it normally belongs to the apache2-bin package.
If required, check package-file integrity:
sudo dpkg -V apache2-bin
Package verification can help identify unexpectedly modified permissions or file contents.
Step 6: Correct the executable permission if it is the source of the failure.
In the supplied video, the candidate executes:
sudo chmod +x /usr/sbin/apache2
This is an important observation.
The command adds execute permission to the Apache executable according to the applicable chmod rules.
However, the candidate does not visibly demonstrate the earlier diagnostic output proving that missing execute permission caused the failure.
If the executable genuinely lacks its required execute permission, restore its expected mode:
sudo chmod 755 /usr/sbin/apache2
* chmod changes file permissions.
* 755 grants read, write and execute permissions to the owner.
* 755 grants read and execute permissions to the group.
* 755 grants read and execute permissions to other users.
This is appropriate for a standard root-owned Apache executable when its mode has been incorrectly changed.
Do not execute this as a universal fix if the actual failure is a configuration error or port conflict.
Step 7: Verify the corrected permissions.
Execute:
ls -l /usr/sbin/apache2
Expected permissions, assuming the standard installation:
-rwxr-xr-x
For numerical verification:
stat -c '%a %n' /usr/sbin/apache2
Expected:
755 /usr/sbin/apache2
If the file's ownership is also incorrect, compare it with the package's expected ownership before making additional changes.
Step 8: Check the Apache configuration syntax.
Execute:
sudo apache2ctl configtest
This checks the Apache configuration for syntax errors.
For a valid configuration, the expected output is:
Syntax OK
The Apache control utility supports the configtest operation specifically for validating configuration syntax.
Apache HTTP Server Version 2.4
If it reports an error, inspect the identified file and line.
For example, an illustrative error might be:
Syntax error on line 42 of /etc/apache2/apache2.conf
Invalid command 'InvalidDirective'
In that case, correct the configuration directive instead of modifying executable permissions.
A successful syntax check does not guarantee that Apache can start, but it eliminates many configuration- related problems.
Step 9: Check whether Apache's required network ports are available.
Apache commonly listens on TCP port 80 for HTTP and port 443 for HTTPS.
Execute:
sudo ss -ltnp
To examine those ports specifically:
sudo ss -ltnp | grep -E ':(80|443)\b'
If another service already occupies a port configured for Apache, startup may fail with an address-binding error.
The official Apache documentation identifies port-binding conflicts as a common startup failure.
Apache HTTP Server Version 2.4
Do not stop another service unless the diagnostic evidence establishes that it is the source of the problem and the change is appropriate.
Step 10: Check Apache's own error log if necessary.
Execute:
sudo tail -n 50 /var/log/apache2/error.log
This displays recent entries from the standard Ubuntu Apache error log.
The file may contain additional details not included in the systemd journal.
Look for permission errors, configuration failures, missing resources or binding errors.
If the executable-permission repair was the only required correction, there may be no additional configuration changes to make.
Step 11: Start the Apache service.
After correcting the identified problem, execute:
sudo systemctl start apache2
* sudo provides administrative privileges.
* systemctl manages systemd services.
* start requests that the specified service begin running.
* apache2 identifies the Apache service unit.
This command directly satisfies the task's instruction to start the systemd service.
In the video, the candidate uses:
sudo systemctl restart apache2
The restart operation stops and starts an active service or starts it when appropriate.
Either operation can result in Apache running, but systemctl start apache2 is the more direct choice when the service is currently stopped or failed.
Step 12: Verify that Apache is running.
Execute:
sudo systemctl status apache2
Expected successful status:
# apache2.service - The Apache HTTP Server
Loaded: loaded
Active: active (running)
The critical field is:
Active: active (running)
This indicates that systemd considers the service active.
The official systemctl documentation defines the status command as the way to inspect the current runtime state of a service unit.
Linux manual page
Step 13: Verify the active service state directly.
Execute:
systemctl is-active apache2
Expected output:
active
Check the exit status immediately afterward:
echo $?
Expected:
0
The service is considered active when systemctl is-active returns active with a successful exit status.
Step 14: Verify that Apache is listening for connections.
Execute:
sudo ss -ltnp | grep apache2
This should display Apache processes listening on the ports specified in its configuration, provided those sockets can be associated with the process in the command output.
Alternatively, check the configured HTTP port:
sudo ss -ltnp | grep ':80'
An illustrative successful result might include:
LISTEN 0 511 0.0.0.0:80 0.0.0.0:*
The actual listening address and ports depend on Apache's configuration.
Step 15: Test the Apache HTTP service.
Execute:
curl
-I http://localhost
This sends an HTTP HEAD request to the local web server.
An example of a successful HTTP response is:
HTTP/1.1 200 OK
Server: Apache/2.4.x (Ubuntu)
Content-Type: text/html
The exact response code depends on the website's configuration. For example, a redirect or authentication response can still show that Apache is accepting connections.
If the service is active but HTTP requests fail, inspect its listener configuration and logs.
Step 16: Confirm that the service remains running.
Execute:
sleep 5
systemctl is-active apache2
Expected:
active
This additional check helps detect a service that starts briefly and then fails.
You can also inspect recent logs:
sudo journalctl -u apache2 -n 20 --no-pager
Confirm that no further startup or runtime failures have occurred.
Step 17: Perform final verification.
Execute:
sudo apache2ctl configtest
systemctl is-active apache2
sudo systemctl status apache2 --no-pager
curl
-I http://localhost
The final requirements are:
Verification
Expected result
Apache configuration test
Syntax OK
Apache executable permission
Valid executable permissions
systemd service status
active (running)
HTTP connectivity
A valid response from the configured service
Original startup failure
Resolved
Final Solution
The video suggests the failure may be related to execute permission on /usr/sbin/apache2. The following is the concise command sequence for that specific confirmed failure.
1. Connect to the server.
ssh lfcs00101a
2. Check the service failure.
sudo systemctl status apache2
sudo journalctl -u apache2 -n 50 --no-pager
3. Inspect the Apache executable permissions.
ls -l /usr/sbin/apache2
4. Restore executable permissions if they are incorrect.
sudo chmod 755 /usr/sbin/apache2
5. Validate the Apache configuration.
sudo apache2ctl configtest
6. Start the Apache service.
sudo systemctl start apache2
7. Verify the running service.
sudo systemctl status apache2
systemctl is-active apache2
Expected:
active
8. Verify HTTP connectivity.
curl
-I http://localhost
Technical Verification and References
The procedures are consistent with official Apache and systemd documentation:
* Apache HTTP Server - apachectl and configtest
* Apache HTTP Server - Startup and Troubleshooting
* Linux systemctl - Managing Service Units
* systemd journalctl - Service Log Inspection
Expected result: The cause preventing apache2 from starting is corrected, and the service is successfully started with systemd and remains in the active (running) state.
Video verification finding: The candidate visibly runs sudo chmod +x /usr/sbin/apache2 and then attempts to restart Apache. That is a valid repair if missing executable permission was the actual fault, but the visible commands do not independently prove the diagnosis or final service state. The diagnostic and verification steps above are necessary for a reliable solution.
Which of the following commands changes the number of days before the ext3 filesystem on /dev/sda1 has to run through a full filesystem check while booting?
정답: B
CORRECT TEXT
What is the lowest numbered unprivileged TCP port? (Specify the number in digits only.)
What is the lowest numbered unprivileged TCP port? (Specify the number in digits only.)
정답:
1024
Which of the following commands lists all defined variables and functions within Bash?
정답: D
CORRECT TEXT
Which command is used to create and initialize the files used to store quota information? (Specify ONLY the commandwithout any path or parameters.)
Which command is used to create and initialize the files used to store quota information? (Specify ONLY the commandwithout any path or parameters.)
정답:
quotacheck
Context
You are asked to install a GNU software package from source code.
Task
First, configure the software package at ~/bool with all default settings.
The software package has been unpacked and all tools required for a configuration have been pre-installed for your convenience.
Next, build the software package at ~/bool.
All tools and dependent libraries required for compilation have been pre-installed for your convenience.
Finally, install the built software package.
You are asked to install a GNU software package from source code.
Task
First, configure the software package at ~/bool with all default settings.
The software package has been unpacked and all tools required for a configuration have been pre-installed for your convenience.
Next, build the software package at ~/bool.
All tools and dependent libraries required for compilation have been pre-installed for your convenience.
Finally, install the built software package.
정답:
See the complete solution in Explanation.
Explanation:
Objective: Configure, compile, and install the GNU software package already extracted into ~/bool, using its default build and installation settings.
The standard GNU build procedure consists of three main commands, executed in this exact order:
/configure
make
sudo make install
The official GNU Autoconf and Automake documentation confirms this sequence for packages using the GNU build system.
Step 1: Connect to the correct Linux server.
The task is associated with host lfcs00102.
From the candidate terminal, execute:
ssh lfcs00102
This establishes an SSH session with the server where the source-code package must be configured, compiled, and installed.
All subsequent commands must be executed on this host.
Step 2: Navigate to the software source directory.
Execute:
cd ~/bool
* cd changes the working directory.
* ~ represents the current user's home directory.
* bool is the directory containing the extracted software source code.
Verify the current directory:
pwd
Expected structure:
/home/candidate/bool
The actual home directory depends on the account used on the host.
Step 3: Inspect the extracted source files.
Execute:
ls -la
A GNU Autotools-based source package commonly contains files such as:
configure
Makefile.am
Makefile.in
configure.ac
README
INSTALL
src/
These are examples of commonly encountered files; the actual directory contents may differ.
The critical file for the first stage is:
configure
The task explicitly states that the package has already been unpacked and the required development tools are installed.
Therefore, there is no need to download another source archive, extract additional files, or install development packages.
Step 4: Verify that the configuration script exists.
Execute:
ls -l ./configure
Then check whether it is executable:
test -x ./configure
echo $?
Expected exit code:
0
If the file is readable but lacks execution permission, you can inspect its permissions:
stat -c '%A %a %n' ./configure
Before changing permissions, confirm that the file is the actual generated configuration script.
If necessary, a readable configure shell script can also be executed with:
sh ./configure
However, the normal and preferred invocation for this task is ./configure.
Step 5: Configure the software package using all default settings.
Execute:
/configure
This is the first essential command.
The configure script examines the system and prepares the source tree for compilation.
Typical checks include:
* Operating system and processor architecture.
* Available C compiler.
* Compiler capabilities and flags.
* Required libraries and header files.
* Build utilities and dependencies.
* Installation directory configuration.
* Generation of Makefiles.
An illustrative output might include:
checking for gcc... gcc
checking whether the C compiler works... yes
checking for stdio.h... yes
checking for stdlib.h... yes
checking for make... make
configure: creating ./config.status
config.status: creating Makefile
The output will differ according to the source package.
Important: The task requires all default settings. Therefore, do not specify configuration arguments such as:
/configure --prefix=/opt/bool
or:
/configure --disable-shared
unless explicitly requested.
Using plain ./configure ensures that the package's own default configuration options are selected.
GNU Autoconf documents that the default installation prefix is commonly /usr/local, although packages can choose another default.
Step 6: Verify that configuration completed successfully.
Immediately after ./configure finishes, execute:
echo $?
Expected:
0
Exit status 0 indicates that the configuration script completed successfully.
Next, verify the generated Makefile:
ls -l Makefile
You can also check for the configuration status file:
ls -l config.status
For a standard Autoconf package, these files indicate that configuration generated the instructions required for compilation.
If configuration reports a missing dependency or another error, investigate that specific error before proceeding to the build stage.
Do not assume that configuration succeeded merely because some files were generated.
Step 7: Inspect the generated Makefile.
Execute:
ls -lh Makefile
The Makefile contains the instructions that GNU Make uses to build and install the software.
You can inspect the default installation prefix:
grep -E '^prefix[[:space:]]*=' Makefile
A typical result is:
prefix = /usr/local
This means that the package is configured to install files under /usr/local, unless it defines different destinations.
Common GNU installation directories include:
Directory
Typical purpose
/usr/local/bin
User executables
/usr/local/sbin
Administration executables
/usr/local/lib
Program libraries
/usr/local/include
Header files
/usr/local/share
Architecture-independent data
Do not modify the installation prefix because the task requires the default settings.
Step 8: Build the software package.
Execute the second essential command:
make
This instructs GNU Make to build the software using the generated Makefile.
During compilation, Make may perform operations such as:
* Reading the Makefile.
* Identifying source files and dependencies.
* Invoking the compiler.
* Compiling source files into object files.
* Linking object files with required libraries.
* Producing executable programs or library files.
For a package written in C, an illustrative compilation sequence may look like:
gcc -DHAVE_CONFIG_H -I. -c main.c -o main.o
gcc -DHAVE_CONFIG_H -I. -c util.c -o util.o
gcc -o program main.o util.o
These commands are examples. The actual compilation operations depend on the package.
GNU Make normally builds the default target when invoked without arguments. For standard GNU packages, this is equivalent to the all target.
Step 9: Understand why make should normally run without sudo.
The recommended command is:
make
Not:
sudo make
Building as the normal user is preferable because it avoids creating root-owned intermediate files inside the source directory.
Administrative privileges are generally necessary only when installing files into protected system directories.
Since the task states that all build dependencies are already installed, the compilation should not require additional package installation.
Step 10: Verify that compilation completed successfully.
Immediately after make finishes, execute:
echo $?
Expected output:
0
This confirms that the Make process returned a successful exit status.
If compilation fails, the terminal normally reports an error, such as:
make: *** [Makefile:150: all] Error 2
Such output indicates a failed build.
Investigate the preceding compiler or linker error before continuing.
Do not attempt to install a package that has not built successfully.
Step 11: Confirm the build target is up to date.
You can run:
make
again after a successful build.
If no source files have changed, Make may display:
make: Nothing to be done for 'all'.
Alternatively, it may run a small number of checks or other build commands.
This is expected behavior: Make determines which targets need rebuilding based on its rules and dependencies.
A second build is optional and does not replace checking the first command's exit status.
Step 12: Run the package tests if supported.
Many GNU software packages provide an optional test target:
make check
This runs tests defined by the package's build system.
The official GNU Automake documentation defines make check as the conventional test-suite target.
However, the task does not explicitly require running tests.
Therefore, this step is optional. Use it only if the package provides the target and running the tests is appropriate.
If tests are run, verify their outcome:
echo $?
Expected successful status:
0
Do not confuse make check with make install. Tests validate a build but do not necessarily install it.
Step 13: Install the compiled software package.
After a successful build, execute:
sudo make install
This is the third essential command.
* sudo provides administrative privileges.
* make executes the build system's specified target.
* install invokes the Makefile's installation rules.
The command installs the compiled software into its configured destinations.
Depending on the package, installation may include:
* Copying executable binaries.
* Installing shared or static libraries.
* Installing header files.
* Installing documentation and manual pages.
* Installing additional package data.
The installation location follows the settings selected during ./configure.
GNU Automake confirms that make install copies the required built files into their installation directories.
Step 14: Do not change the installation destination.
The task specifically requests the default configuration.
Therefore, avoid commands such as:
sudo make install prefix=/opt/custom
Also avoid reconfiguring the package using:
/configure --prefix=/opt/custom
These would change the normal installation destinations.
The appropriate installation command remains:
sudo make install
Step 15: Verify that installation completed successfully.
Immediately after sudo make install finishes, execute:
echo $?
Expected:
0
A zero exit code indicates that the installation target completed successfully.
If installation fails with a permissions error, verify whether administrative privileges were applied correctly and inspect the affected directory.
If a build or dependency error occurs during installation, resolve that error before treating the task as complete.
Step 16: Verify the installation destination.
Inspect the installation prefix recorded in the Makefile:
grep -E '^prefix[[:space:]]*=' Makefile
If the prefix is /usr/local, the installed files will typically be placed in appropriate directories beneath that prefix.
You can inspect standard executable locations:
ls -lt /usr/local/bin/
And, where appropriate:
ls -lt /usr/local/lib/
These commands can help identify newly installed files, but they are not conclusive on their own because other software may already exist in those directories.
For more precise verification, inspect the package's Makefile installation rules or any installation manifest it produces.
Step 17: Verify the installed executable if applicable.
If the package installs an executable, first determine its actual command name from the package's documentation or installation output.
Then execute:
command -v ACTUAL_EXECUTABLE_NAME
For example, if a package installs an executable called example-program:
command -v example-program
You can then check its version if that option is supported:
example-program --version
These commands are illustrative. The directory name bool does not prove that the installed executable is also named bool.
Do not invent an executable name when validating the installation.
Step 18: Run installation checks if the package supports them.
Some GNU packages provide the following target:
make installcheck
This runs checks against installed software rather than files within the build tree.
GNU Automake documents installcheck as an optional target for validating installed programs and libraries.
It is not mandatory for this question.
The task requires configuration, compilation and installation. A successful sudo make install operation satisfies the installation stage.
Step 19: Understand why the three commands must be executed in order.
Order
Command
Purpose
1
/configure
Detects the build environment and prepares Makefiles using default settings
2
make
Compiles and links the source code
3
sudo make install
Installs the built software into the configured system directories
Each stage depends on the preceding stage.
Running make before a successful configuration might fail because the necessary Makefile has not been generated.
Running make install without a successful build may also fail or cause the installation target to attempt compilation. That does not replace the explicitly required build step.
For the LFCS simulation, execute each required stage separately and verify success before continuing.
Step 20: Perform the final verification.
From the source directory:
cd ~/bool
Check the generated Makefile:
test -f Makefile & & echo "Makefile exists"
Check the configuration status file if the package uses Autoconf:
test -f config.status & & echo "Configuration completed"
Confirm the configured prefix:
grep -E '^prefix[[:space:]]*=' Makefile
Check that the build is up to date:
make
Finally, verify the installed files or executable using the actual package name and installation output.
A successful result must satisfy all requirements:
Requirement
Expected result
Correct host
lfcs00102
Source directory
~/bool
Configure with defaults
Successful
Build package
Successful
Install package
Successful
Custom configure options
None
Source extraction
Already completed
Dependency installation
Already completed
Final Solution
The complete essential command sequence is:
Copy commands
# Connect to the designated host
ssh lfcs00102
# Navigate to the extracted source package
cd ~/bool
# Inspect the source files
ls -la
ls -l ./configure
# Step 1: Configure with default settings
/configure
# Step 2: Build the software package
make
# Step 3: Install the built package
sudo make install
To verify the exit status of each stage reliably, use the following alternative, which stops if a required stage fails:
cd ~/bool || exit 1
/configure & &
make & &
sudo make install
This short sequence is appropriate when the provided tools and dependencies are already available, as specified in the task.
Technical Verification and References
The solution has been validated against the official GNU build-system documentation.
* GNU Autoconf Manual - Explains the generated configure script and default configuration settings.
* GNU Make Manual - Explains compilation using Makefiles and Make targets.
* GNU Automake - Standard Targets - Documents make, make check, make install and make installcheck.
Expected result: The GNU software package located at ~/bool is successfully configured using its default settings, compiled using GNU Make, and installed through its Makefile's installation target.
Verification limitation: The prescribed sequence is supported by official GNU documentation. Whether the commands successfully complete on lfcs00102 must be confirmed from their actual terminal output and exit statuses; the supplied recording does not establish an independently tested successful installation.
Explanation:
Objective: Configure, compile, and install the GNU software package already extracted into ~/bool, using its default build and installation settings.
The standard GNU build procedure consists of three main commands, executed in this exact order:
/configure
make
sudo make install
The official GNU Autoconf and Automake documentation confirms this sequence for packages using the GNU build system.
Step 1: Connect to the correct Linux server.
The task is associated with host lfcs00102.
From the candidate terminal, execute:
ssh lfcs00102
This establishes an SSH session with the server where the source-code package must be configured, compiled, and installed.
All subsequent commands must be executed on this host.
Step 2: Navigate to the software source directory.
Execute:
cd ~/bool
* cd changes the working directory.
* ~ represents the current user's home directory.
* bool is the directory containing the extracted software source code.
Verify the current directory:
pwd
Expected structure:
/home/candidate/bool
The actual home directory depends on the account used on the host.
Step 3: Inspect the extracted source files.
Execute:
ls -la
A GNU Autotools-based source package commonly contains files such as:
configure
Makefile.am
Makefile.in
configure.ac
README
INSTALL
src/
These are examples of commonly encountered files; the actual directory contents may differ.
The critical file for the first stage is:
configure
The task explicitly states that the package has already been unpacked and the required development tools are installed.
Therefore, there is no need to download another source archive, extract additional files, or install development packages.
Step 4: Verify that the configuration script exists.
Execute:
ls -l ./configure
Then check whether it is executable:
test -x ./configure
echo $?
Expected exit code:
0
If the file is readable but lacks execution permission, you can inspect its permissions:
stat -c '%A %a %n' ./configure
Before changing permissions, confirm that the file is the actual generated configuration script.
If necessary, a readable configure shell script can also be executed with:
sh ./configure
However, the normal and preferred invocation for this task is ./configure.
Step 5: Configure the software package using all default settings.
Execute:
/configure
This is the first essential command.
The configure script examines the system and prepares the source tree for compilation.
Typical checks include:
* Operating system and processor architecture.
* Available C compiler.
* Compiler capabilities and flags.
* Required libraries and header files.
* Build utilities and dependencies.
* Installation directory configuration.
* Generation of Makefiles.
An illustrative output might include:
checking for gcc... gcc
checking whether the C compiler works... yes
checking for stdio.h... yes
checking for stdlib.h... yes
checking for make... make
configure: creating ./config.status
config.status: creating Makefile
The output will differ according to the source package.
Important: The task requires all default settings. Therefore, do not specify configuration arguments such as:
/configure --prefix=/opt/bool
or:
/configure --disable-shared
unless explicitly requested.
Using plain ./configure ensures that the package's own default configuration options are selected.
GNU Autoconf documents that the default installation prefix is commonly /usr/local, although packages can choose another default.
Step 6: Verify that configuration completed successfully.
Immediately after ./configure finishes, execute:
echo $?
Expected:
0
Exit status 0 indicates that the configuration script completed successfully.
Next, verify the generated Makefile:
ls -l Makefile
You can also check for the configuration status file:
ls -l config.status
For a standard Autoconf package, these files indicate that configuration generated the instructions required for compilation.
If configuration reports a missing dependency or another error, investigate that specific error before proceeding to the build stage.
Do not assume that configuration succeeded merely because some files were generated.
Step 7: Inspect the generated Makefile.
Execute:
ls -lh Makefile
The Makefile contains the instructions that GNU Make uses to build and install the software.
You can inspect the default installation prefix:
grep -E '^prefix[[:space:]]*=' Makefile
A typical result is:
prefix = /usr/local
This means that the package is configured to install files under /usr/local, unless it defines different destinations.
Common GNU installation directories include:
Directory
Typical purpose
/usr/local/bin
User executables
/usr/local/sbin
Administration executables
/usr/local/lib
Program libraries
/usr/local/include
Header files
/usr/local/share
Architecture-independent data
Do not modify the installation prefix because the task requires the default settings.
Step 8: Build the software package.
Execute the second essential command:
make
This instructs GNU Make to build the software using the generated Makefile.
During compilation, Make may perform operations such as:
* Reading the Makefile.
* Identifying source files and dependencies.
* Invoking the compiler.
* Compiling source files into object files.
* Linking object files with required libraries.
* Producing executable programs or library files.
For a package written in C, an illustrative compilation sequence may look like:
gcc -DHAVE_CONFIG_H -I. -c main.c -o main.o
gcc -DHAVE_CONFIG_H -I. -c util.c -o util.o
gcc -o program main.o util.o
These commands are examples. The actual compilation operations depend on the package.
GNU Make normally builds the default target when invoked without arguments. For standard GNU packages, this is equivalent to the all target.
Step 9: Understand why make should normally run without sudo.
The recommended command is:
make
Not:
sudo make
Building as the normal user is preferable because it avoids creating root-owned intermediate files inside the source directory.
Administrative privileges are generally necessary only when installing files into protected system directories.
Since the task states that all build dependencies are already installed, the compilation should not require additional package installation.
Step 10: Verify that compilation completed successfully.
Immediately after make finishes, execute:
echo $?
Expected output:
0
This confirms that the Make process returned a successful exit status.
If compilation fails, the terminal normally reports an error, such as:
make: *** [Makefile:150: all] Error 2
Such output indicates a failed build.
Investigate the preceding compiler or linker error before continuing.
Do not attempt to install a package that has not built successfully.
Step 11: Confirm the build target is up to date.
You can run:
make
again after a successful build.
If no source files have changed, Make may display:
make: Nothing to be done for 'all'.
Alternatively, it may run a small number of checks or other build commands.
This is expected behavior: Make determines which targets need rebuilding based on its rules and dependencies.
A second build is optional and does not replace checking the first command's exit status.
Step 12: Run the package tests if supported.
Many GNU software packages provide an optional test target:
make check
This runs tests defined by the package's build system.
The official GNU Automake documentation defines make check as the conventional test-suite target.
However, the task does not explicitly require running tests.
Therefore, this step is optional. Use it only if the package provides the target and running the tests is appropriate.
If tests are run, verify their outcome:
echo $?
Expected successful status:
0
Do not confuse make check with make install. Tests validate a build but do not necessarily install it.
Step 13: Install the compiled software package.
After a successful build, execute:
sudo make install
This is the third essential command.
* sudo provides administrative privileges.
* make executes the build system's specified target.
* install invokes the Makefile's installation rules.
The command installs the compiled software into its configured destinations.
Depending on the package, installation may include:
* Copying executable binaries.
* Installing shared or static libraries.
* Installing header files.
* Installing documentation and manual pages.
* Installing additional package data.
The installation location follows the settings selected during ./configure.
GNU Automake confirms that make install copies the required built files into their installation directories.
Step 14: Do not change the installation destination.
The task specifically requests the default configuration.
Therefore, avoid commands such as:
sudo make install prefix=/opt/custom
Also avoid reconfiguring the package using:
/configure --prefix=/opt/custom
These would change the normal installation destinations.
The appropriate installation command remains:
sudo make install
Step 15: Verify that installation completed successfully.
Immediately after sudo make install finishes, execute:
echo $?
Expected:
0
A zero exit code indicates that the installation target completed successfully.
If installation fails with a permissions error, verify whether administrative privileges were applied correctly and inspect the affected directory.
If a build or dependency error occurs during installation, resolve that error before treating the task as complete.
Step 16: Verify the installation destination.
Inspect the installation prefix recorded in the Makefile:
grep -E '^prefix[[:space:]]*=' Makefile
If the prefix is /usr/local, the installed files will typically be placed in appropriate directories beneath that prefix.
You can inspect standard executable locations:
ls -lt /usr/local/bin/
And, where appropriate:
ls -lt /usr/local/lib/
These commands can help identify newly installed files, but they are not conclusive on their own because other software may already exist in those directories.
For more precise verification, inspect the package's Makefile installation rules or any installation manifest it produces.
Step 17: Verify the installed executable if applicable.
If the package installs an executable, first determine its actual command name from the package's documentation or installation output.
Then execute:
command -v ACTUAL_EXECUTABLE_NAME
For example, if a package installs an executable called example-program:
command -v example-program
You can then check its version if that option is supported:
example-program --version
These commands are illustrative. The directory name bool does not prove that the installed executable is also named bool.
Do not invent an executable name when validating the installation.
Step 18: Run installation checks if the package supports them.
Some GNU packages provide the following target:
make installcheck
This runs checks against installed software rather than files within the build tree.
GNU Automake documents installcheck as an optional target for validating installed programs and libraries.
It is not mandatory for this question.
The task requires configuration, compilation and installation. A successful sudo make install operation satisfies the installation stage.
Step 19: Understand why the three commands must be executed in order.
Order
Command
Purpose
1
/configure
Detects the build environment and prepares Makefiles using default settings
2
make
Compiles and links the source code
3
sudo make install
Installs the built software into the configured system directories
Each stage depends on the preceding stage.
Running make before a successful configuration might fail because the necessary Makefile has not been generated.
Running make install without a successful build may also fail or cause the installation target to attempt compilation. That does not replace the explicitly required build step.
For the LFCS simulation, execute each required stage separately and verify success before continuing.
Step 20: Perform the final verification.
From the source directory:
cd ~/bool
Check the generated Makefile:
test -f Makefile & & echo "Makefile exists"
Check the configuration status file if the package uses Autoconf:
test -f config.status & & echo "Configuration completed"
Confirm the configured prefix:
grep -E '^prefix[[:space:]]*=' Makefile
Check that the build is up to date:
make
Finally, verify the installed files or executable using the actual package name and installation output.
A successful result must satisfy all requirements:
Requirement
Expected result
Correct host
lfcs00102
Source directory
~/bool
Configure with defaults
Successful
Build package
Successful
Install package
Successful
Custom configure options
None
Source extraction
Already completed
Dependency installation
Already completed
Final Solution
The complete essential command sequence is:
Copy commands
# Connect to the designated host
ssh lfcs00102
# Navigate to the extracted source package
cd ~/bool
# Inspect the source files
ls -la
ls -l ./configure
# Step 1: Configure with default settings
/configure
# Step 2: Build the software package
make
# Step 3: Install the built package
sudo make install
To verify the exit status of each stage reliably, use the following alternative, which stops if a required stage fails:
cd ~/bool || exit 1
/configure & &
make & &
sudo make install
This short sequence is appropriate when the provided tools and dependencies are already available, as specified in the task.
Technical Verification and References
The solution has been validated against the official GNU build-system documentation.
* GNU Autoconf Manual - Explains the generated configure script and default configuration settings.
* GNU Make Manual - Explains compilation using Makefiles and Make targets.
* GNU Automake - Standard Targets - Documents make, make check, make install and make installcheck.
Expected result: The GNU software package located at ~/bool is successfully configured using its default settings, compiled using GNU Make, and installed through its Makefile's installation target.
Verification limitation: The prescribed sequence is supported by official GNU documentation. Whether the commands successfully complete on lfcs00102 must be confirmed from their actual terminal output and exit statuses; the supplied recording does not establish an independently tested successful installation.
Task
First, configure the NFS server to allow access to /srv/backup for host lfcs00098nfs1 to store backups.
You must include the insecure option.
Next, configure the NFS server to allow access to /srv/backup for host lfcs00098nfs2 to restore backups only.
You must include the insecure option.
First, configure the NFS server to allow access to /srv/backup for host lfcs00098nfs1 to store backups.
You must include the insecure option.
Next, configure the NFS server to allow access to /srv/backup for host lfcs00098nfs2 to restore backups only.
You must include the insecure option.
정답:
See the complete solution in Explanation.
Explanation:
Objective: Configure the Linux NFS (Network File System) server so that two specified client hosts can access the same backup directory with different permissions.
The required configuration is:
NFS client
Required access
Export options
lfcs00098nfs1
Read and write (store backups)
rw,sync,insecure
lfcs00098nfs2
Read-only (restore backups)
ro,sync,insecure
The essential distinction is that the first client must be able to create and modify backup files, while the second client must be restricted to reading existing backup data.
The task explicitly requires the insecure option for both client hosts.
Linux NFS uses /etc/exports to configure which directories are shared, which hosts can access them, and which permissions apply.
Step 1: Connect to the correct Linux server.
The video specifies that this task must be completed on host lfcs00098.
From the candidate terminal, execute:
ssh lfcs00098
This establishes an SSH connection to the designated NFS server.
All NFS export configuration changes must be performed on this server, not on the client hosts.
Step 2: Verify that the NFS server software is installed.
On the Ubuntu environment shown in the video, the NFS server package is normally:
nfs-kernel-server
Check whether the package is installed:
dpkg -l nfs-kernel-server
You can also inspect the service:
systemctl status nfs-kernel-server
If the package is installed and the service is running, continue.
The task is to configure an existing NFS server, so do not reinstall packages unnecessarily.
Step 3: Verify that the backup directory exists.
The task specifies the NFS export directory:
/srv/backup
Execute:
ls -ld /srv/backup
This displays the directory's permissions, owner and group.
For example:
drwxr-xr-x 2 root root 4096 Oct 12 10:00 /srv/backup
The output above is illustrative.
If the directory does not exist, first establish whether the task environment is incomplete. If it is genuinely necessary to create the specified export point, execute:
sudo mkdir -p /srv/backup
Do not modify existing backup files or directory ownership unless needed for authorized client access.
Step 4: Inspect the existing NFS export configuration.
The primary NFS export configuration file is:
/etc/exports
Display its contents:
sudo cat /etc/exports
You can also inspect the configuration using:
sudo nano /etc/exports
The file defines local directories exported to NFS clients.
The general format is:
/directory client1(options) client2(options)
Each client hostname is immediately followed by its own parenthesized options.
There must be no space between the hostname and the opening parenthesis.
This syntax is explicitly documented in the Linux NFS exports(5) manual.
Step 5: Check the currently active NFS exports.
Execute:
sudo exportfs -v
This lists the currently active exports and their effective options.
Check whether /srv/backup is already exported and whether either required client already has an entry.
If an existing configuration is present, modify it carefully rather than creating overlapping or conflicting export entries.
Step 6: Verify that the NFS client hostnames can be resolved.
The task identifies two clients:
lfcs00098nfs1
lfcs00098nfs2
Check name resolution:
getent hosts lfcs00098nfs1
Then:
getent hosts lfcs00098nfs2
These commands query the operating system's configured hostname-resolution services.
Both hostnames should resolve correctly in the exam environment.
Do not replace these hostnames with invented IP addresses.
NFS export configuration supports hostnames, including single hostnames recognized by the system resolver.
Step 7: Back up the existing NFS exports configuration.
Before making changes, execute:
sudo cp -a /etc/exports /etc/exports.bak
This creates a backup copy while preserving file metadata.
It allows recovery if the configuration is accidentally modified incorrectly.
Step 8: Edit the /etc/exports file.
Execute:
sudo nano /etc/exports
Alternatively:
sudo vim /etc/exports
Navigate to the end of the file, or locate the existing export for /srv/backup if one is already present.
Step 9: Configure read/write access for the backup-storage client.
The first requirement is:
First, configure the NFS server to allow access to /srv/backup for host lfcs00098nfs1 to store backups.
The corresponding export configuration is:
/srv/backup lfcs00098nfs1(rw,sync,insecure)
/srv/backup
This is the directory that the NFS server makes available to the specified client.
lfcs00098nfs1
This is the only client identified by this entry.
rw - Read/Write
Allows the NFS client to perform both read and write operations, subject to the underlying filesystem permissions.
This is necessary because the client must store backups.
sync - Synchronous Writes
Makes the NFS server acknowledge write requests only after the relevant changes have been committed to stable storage, as defined by the NFS server's write semantics.
This is appropriate for backup data where durability matters.
insecure - Allow Unprivileged Source Ports
Normally, NFS's secure export behavior requires certain client requests to originate from a privileged port below 1024.
The insecure option relaxes this restriction, permitting requests from unprivileged source ports.
The task explicitly requires this option.
The official NFS manual confirms the behavior of rw, sync and insecure.
Step 10: Configure read-only access for the backup-restore client.
The second requirement is:
Next, configure the NFS server to allow access to /srv/backup for host lfcs00098nfs2 to restore backups only.
The corresponding configuration is:
/srv/backup lfcs00098nfs2(ro,sync,insecure)
lfcs00098nfs2
Specifies the second authorized NFS client.
ro - Read Only
Allows the client to read existing backup files but prevents writes through the NFS export.
This matches the requirement to restore backups only.
sync
Specifies synchronous server behavior. It is safe to include this option even though the export is read-only.
insecure
Allows requests from unprivileged client source ports, as explicitly requested.
The most important difference between the two client definitions is:
lfcs00098nfs1(rw,sync,insecure)
lfcs00098nfs2(ro,sync,insecure)
The second client must not be given rw access.
Step 11: Add the complete NFS export configuration.
The preferred combined entry in /etc/exports is:
/srv/backup lfcs00098nfs1(rw,sync,insecure) lfcs00098nfs2(ro,sync,insecure) This single line defines the same exported directory with separate permissions for the two clients.
The configuration can also be expressed as two client-specific entries, provided the resulting export table is valid and does not contain conflicting definitions.
Using one line is concise and follows the official exports(5) syntax for multiple clients sharing an export path.
NFS server export table
Step 12: Save the NFS configuration file.
If using Nano, press Ctrl+O, Enter and Ctrl+X.
If using Vim, press Esc, type :wq, and press Enter.
Verify the saved configuration:
sudo cat /etc/exports
The file must contain:
/srv/backup lfcs00098nfs1(rw,sync,insecure) lfcs00098nfs2(ro,sync,insecure) Preserve any unrelated exports already present on the system.
Step 13: Apply the NFS export configuration.
Execute:
sudo exportfs -ra
* exportfs manages the NFS export table.
* -r refreshes the export table from the configuration.
* -a applies the operation to all configured exports.
This command reloads export definitions without requiring a complete operating system reboot.
For verbose output, you can execute:
sudo exportfs -rav
Ubuntu's official NFS server documentation and the Linux NFS manual describe using exportfs to apply changes made to /etc/exports.
Step 14: Verify the active NFS export configuration.
Execute:
sudo exportfs -v
The output should show /srv/backup exported to both client hosts.
The effective configuration must include the following permissions:
Client
Required effective access
lfcs00098nfs1
rw,insecure
lfcs00098nfs2
ro,insecure
The command may also display other default export options such as root_squash, wdelay, sec=sys, or no_subtree_check, depending on the installed version and configuration.
Their presence does not necessarily indicate an error.
What matters is that the two specified clients have the correct effective access and the required insecure option.
Step 15: Check the NFS server service.
Execute:
sudo systemctl status nfs-kernel-server
The service should report an active operating state.
For a concise check:
systemctl is-active nfs-kernel-server
Expected:
active
If the service is inactive, inspect the logs:
sudo journalctl -u nfs-kernel-server -n 50 --no-pager
If the service is installed and configured correctly but stopped, start it:
sudo systemctl start nfs-kernel-server
There is ordinarily no need to restart a healthy NFS server merely because export rules changed; exportfs -ra is designed to refresh the export table.
Step 16: Verify the backup directory permissions.
Execute:
ls -ld /srv/backup
NFS export permissions and Unix filesystem permissions are separate controls.
Even if lfcs00098nfs1 has an export configured with rw, its application user must also have the necessary filesystem permissions to write to the directory.
Likewise, ro at the export level prevents NFS writes from lfcs00098nfs2, regardless of permissive underlying file permissions.
Do not automatically execute:
sudo chmod 777 /srv/backup
This would unnecessarily grant broad filesystem access.
Also avoid adding:
no_root_squash
unless explicitly required.
The task does not request disabling NFS root squashing, and doing so could expose unnecessary privileges to clients.
Step 17: Verify NFS access from the backup-storage client.
If the client is accessible, connect to:
ssh lfcs00098nfs1
Create a temporary mountpoint:
sudo mkdir -p /mnt/lfcs-backup-test
Mount the NFS export, using the actual NFS server hostname and a protocol version supported by the server:
sudo mount -t nfs lfcs00098:/srv/backup /mnt/lfcs-backup-test
Verify the mount:
findmnt /mnt/lfcs-backup-test
Using a client identity authorized to write to the backup directory, test file creation:
touch /mnt/lfcs-backup-test/lfcs-write-test
If the directory permissions permit this identity to write, the command should succeed.
This tests the read/write access requested for lfcs00098nfs1.
Root access from the client may be mapped to an unprivileged user because of NFS root squashing, so a failure when using root does not automatically mean that the export is configured incorrectly.
Step 18: Verify read-only access from the restore client.
Connect to:
ssh lfcs00098nfs2
Create a mountpoint if necessary:
sudo mkdir -p /mnt/lfcs-backup-test
Mount the export:
sudo mount -t nfs lfcs00098:/srv/backup /mnt/lfcs-backup-test
Verify that backup files can be listed and read:
ls -la /mnt/lfcs-backup-test
Where a readable file is available, open or inspect it using a suitable command.
Next, attempt to create a temporary file:
touch /mnt/lfcs-backup-test/lfcs-readonly-test
This operation must fail because the export is read-only.
An illustrative error is:
Read-only file system
Even if the error wording differs, the important result is that write access is denied by the server.
Step 19: Clean up any test resources.
On the writing client, remove only the temporary verification file you created:
rm -f /mnt/lfcs-backup-test/lfcs-write-test
Unmount the temporary client mount:
sudo umount /mnt/lfcs-backup-test
Repeat the unmount on the other client.
Do not delete or alter actual backup files.
Step 20: Perform final verification on the NFS server.
Reconnect to the NFS server:
ssh lfcs00098
Verify the persistent configuration:
sudo grep '/srv/backup' /etc/exports
Expected:
/srv/backup lfcs00098nfs1(rw,sync,insecure) lfcs00098nfs2(ro,sync,insecure) Verify the active exports:
sudo exportfs -v
Confirm NFS service health:
systemctl is-active nfs-kernel-server
The final state must satisfy every requirement.
Requirement
Expected result
Exported directory
/srv/backup
Backup-storage client
lfcs00098nfs1
Backup-storage access
Read/write
Backup-restore client
lfcs00098nfs2
Backup-restore access
Read-only
insecure for first client
Present
insecure for second client
Present
Active exports
Correctly refreshed
NFS service
Active
Final Solution
The essential server-side commands are:
# Connect to the NFS server
ssh lfcs00098
# Check the export directory
ls -ld /srv/backup
# Examine existing exports
sudo cat /etc/exports
sudo exportfs -v
# Back up the configuration
sudo cp -a /etc/exports /etc/exports.bak
# Edit the exports file
sudo nano /etc/exports
Add or update the /srv/backup entry to read:
/srv/backup lfcs00098nfs1(rw,sync,insecure) lfcs00098nfs2(ro,sync,insecure) Save and execute:
# Apply changes
sudo exportfs -ra
# Verify active exports
sudo exportfs -v
# Confirm NFS service status
systemctl is-active nfs-kernel-server
# Verify persistent configuration
sudo grep '/srv/backup' /etc/exports
Technical Verification and References
The solution has been checked against the official Linux NFS manuals and Ubuntu Server documentation.
* Linux NFS exports(5) - Defines the export configuration syntax, rw, ro, sync and insecure options.
* Ubuntu Server - Network File System (NFS) - Documents the NFS server configuration and export- management procedure.
* Linux exportfs(8) - Documents reloading, managing and displaying active exports.
Video verification finding: Task 10 identifies the NFS server lfcs00098 and requires separate access modes for lfcs00098nfs1 and lfcs00098nfs2. The essential answer is the NFS export configuration above. Actual client access must be tested on the relevant systems; correct syntax alone does not establish that network connectivity and filesystem permissions are functioning.
Expected result: The NFS server exports /srv/backup to lfcs00098nfs1 with read/write access and to lfcs00098nfs2 with read-only access. Both client configurations explicitly include insecure, and the settings remain persistent in /etc/exports.
Explanation:
Objective: Configure the Linux NFS (Network File System) server so that two specified client hosts can access the same backup directory with different permissions.
The required configuration is:
NFS client
Required access
Export options
lfcs00098nfs1
Read and write (store backups)
rw,sync,insecure
lfcs00098nfs2
Read-only (restore backups)
ro,sync,insecure
The essential distinction is that the first client must be able to create and modify backup files, while the second client must be restricted to reading existing backup data.
The task explicitly requires the insecure option for both client hosts.
Linux NFS uses /etc/exports to configure which directories are shared, which hosts can access them, and which permissions apply.
Step 1: Connect to the correct Linux server.
The video specifies that this task must be completed on host lfcs00098.
From the candidate terminal, execute:
ssh lfcs00098
This establishes an SSH connection to the designated NFS server.
All NFS export configuration changes must be performed on this server, not on the client hosts.
Step 2: Verify that the NFS server software is installed.
On the Ubuntu environment shown in the video, the NFS server package is normally:
nfs-kernel-server
Check whether the package is installed:
dpkg -l nfs-kernel-server
You can also inspect the service:
systemctl status nfs-kernel-server
If the package is installed and the service is running, continue.
The task is to configure an existing NFS server, so do not reinstall packages unnecessarily.
Step 3: Verify that the backup directory exists.
The task specifies the NFS export directory:
/srv/backup
Execute:
ls -ld /srv/backup
This displays the directory's permissions, owner and group.
For example:
drwxr-xr-x 2 root root 4096 Oct 12 10:00 /srv/backup
The output above is illustrative.
If the directory does not exist, first establish whether the task environment is incomplete. If it is genuinely necessary to create the specified export point, execute:
sudo mkdir -p /srv/backup
Do not modify existing backup files or directory ownership unless needed for authorized client access.
Step 4: Inspect the existing NFS export configuration.
The primary NFS export configuration file is:
/etc/exports
Display its contents:
sudo cat /etc/exports
You can also inspect the configuration using:
sudo nano /etc/exports
The file defines local directories exported to NFS clients.
The general format is:
/directory client1(options) client2(options)
Each client hostname is immediately followed by its own parenthesized options.
There must be no space between the hostname and the opening parenthesis.
This syntax is explicitly documented in the Linux NFS exports(5) manual.
Step 5: Check the currently active NFS exports.
Execute:
sudo exportfs -v
This lists the currently active exports and their effective options.
Check whether /srv/backup is already exported and whether either required client already has an entry.
If an existing configuration is present, modify it carefully rather than creating overlapping or conflicting export entries.
Step 6: Verify that the NFS client hostnames can be resolved.
The task identifies two clients:
lfcs00098nfs1
lfcs00098nfs2
Check name resolution:
getent hosts lfcs00098nfs1
Then:
getent hosts lfcs00098nfs2
These commands query the operating system's configured hostname-resolution services.
Both hostnames should resolve correctly in the exam environment.
Do not replace these hostnames with invented IP addresses.
NFS export configuration supports hostnames, including single hostnames recognized by the system resolver.
Step 7: Back up the existing NFS exports configuration.
Before making changes, execute:
sudo cp -a /etc/exports /etc/exports.bak
This creates a backup copy while preserving file metadata.
It allows recovery if the configuration is accidentally modified incorrectly.
Step 8: Edit the /etc/exports file.
Execute:
sudo nano /etc/exports
Alternatively:
sudo vim /etc/exports
Navigate to the end of the file, or locate the existing export for /srv/backup if one is already present.
Step 9: Configure read/write access for the backup-storage client.
The first requirement is:
First, configure the NFS server to allow access to /srv/backup for host lfcs00098nfs1 to store backups.
The corresponding export configuration is:
/srv/backup lfcs00098nfs1(rw,sync,insecure)
/srv/backup
This is the directory that the NFS server makes available to the specified client.
lfcs00098nfs1
This is the only client identified by this entry.
rw - Read/Write
Allows the NFS client to perform both read and write operations, subject to the underlying filesystem permissions.
This is necessary because the client must store backups.
sync - Synchronous Writes
Makes the NFS server acknowledge write requests only after the relevant changes have been committed to stable storage, as defined by the NFS server's write semantics.
This is appropriate for backup data where durability matters.
insecure - Allow Unprivileged Source Ports
Normally, NFS's secure export behavior requires certain client requests to originate from a privileged port below 1024.
The insecure option relaxes this restriction, permitting requests from unprivileged source ports.
The task explicitly requires this option.
The official NFS manual confirms the behavior of rw, sync and insecure.
Step 10: Configure read-only access for the backup-restore client.
The second requirement is:
Next, configure the NFS server to allow access to /srv/backup for host lfcs00098nfs2 to restore backups only.
The corresponding configuration is:
/srv/backup lfcs00098nfs2(ro,sync,insecure)
lfcs00098nfs2
Specifies the second authorized NFS client.
ro - Read Only
Allows the client to read existing backup files but prevents writes through the NFS export.
This matches the requirement to restore backups only.
sync
Specifies synchronous server behavior. It is safe to include this option even though the export is read-only.
insecure
Allows requests from unprivileged client source ports, as explicitly requested.
The most important difference between the two client definitions is:
lfcs00098nfs1(rw,sync,insecure)
lfcs00098nfs2(ro,sync,insecure)
The second client must not be given rw access.
Step 11: Add the complete NFS export configuration.
The preferred combined entry in /etc/exports is:
/srv/backup lfcs00098nfs1(rw,sync,insecure) lfcs00098nfs2(ro,sync,insecure) This single line defines the same exported directory with separate permissions for the two clients.
The configuration can also be expressed as two client-specific entries, provided the resulting export table is valid and does not contain conflicting definitions.
Using one line is concise and follows the official exports(5) syntax for multiple clients sharing an export path.
NFS server export table
Step 12: Save the NFS configuration file.
If using Nano, press Ctrl+O, Enter and Ctrl+X.
If using Vim, press Esc, type :wq, and press Enter.
Verify the saved configuration:
sudo cat /etc/exports
The file must contain:
/srv/backup lfcs00098nfs1(rw,sync,insecure) lfcs00098nfs2(ro,sync,insecure) Preserve any unrelated exports already present on the system.
Step 13: Apply the NFS export configuration.
Execute:
sudo exportfs -ra
* exportfs manages the NFS export table.
* -r refreshes the export table from the configuration.
* -a applies the operation to all configured exports.
This command reloads export definitions without requiring a complete operating system reboot.
For verbose output, you can execute:
sudo exportfs -rav
Ubuntu's official NFS server documentation and the Linux NFS manual describe using exportfs to apply changes made to /etc/exports.
Step 14: Verify the active NFS export configuration.
Execute:
sudo exportfs -v
The output should show /srv/backup exported to both client hosts.
The effective configuration must include the following permissions:
Client
Required effective access
lfcs00098nfs1
rw,insecure
lfcs00098nfs2
ro,insecure
The command may also display other default export options such as root_squash, wdelay, sec=sys, or no_subtree_check, depending on the installed version and configuration.
Their presence does not necessarily indicate an error.
What matters is that the two specified clients have the correct effective access and the required insecure option.
Step 15: Check the NFS server service.
Execute:
sudo systemctl status nfs-kernel-server
The service should report an active operating state.
For a concise check:
systemctl is-active nfs-kernel-server
Expected:
active
If the service is inactive, inspect the logs:
sudo journalctl -u nfs-kernel-server -n 50 --no-pager
If the service is installed and configured correctly but stopped, start it:
sudo systemctl start nfs-kernel-server
There is ordinarily no need to restart a healthy NFS server merely because export rules changed; exportfs -ra is designed to refresh the export table.
Step 16: Verify the backup directory permissions.
Execute:
ls -ld /srv/backup
NFS export permissions and Unix filesystem permissions are separate controls.
Even if lfcs00098nfs1 has an export configured with rw, its application user must also have the necessary filesystem permissions to write to the directory.
Likewise, ro at the export level prevents NFS writes from lfcs00098nfs2, regardless of permissive underlying file permissions.
Do not automatically execute:
sudo chmod 777 /srv/backup
This would unnecessarily grant broad filesystem access.
Also avoid adding:
no_root_squash
unless explicitly required.
The task does not request disabling NFS root squashing, and doing so could expose unnecessary privileges to clients.
Step 17: Verify NFS access from the backup-storage client.
If the client is accessible, connect to:
ssh lfcs00098nfs1
Create a temporary mountpoint:
sudo mkdir -p /mnt/lfcs-backup-test
Mount the NFS export, using the actual NFS server hostname and a protocol version supported by the server:
sudo mount -t nfs lfcs00098:/srv/backup /mnt/lfcs-backup-test
Verify the mount:
findmnt /mnt/lfcs-backup-test
Using a client identity authorized to write to the backup directory, test file creation:
touch /mnt/lfcs-backup-test/lfcs-write-test
If the directory permissions permit this identity to write, the command should succeed.
This tests the read/write access requested for lfcs00098nfs1.
Root access from the client may be mapped to an unprivileged user because of NFS root squashing, so a failure when using root does not automatically mean that the export is configured incorrectly.
Step 18: Verify read-only access from the restore client.
Connect to:
ssh lfcs00098nfs2
Create a mountpoint if necessary:
sudo mkdir -p /mnt/lfcs-backup-test
Mount the export:
sudo mount -t nfs lfcs00098:/srv/backup /mnt/lfcs-backup-test
Verify that backup files can be listed and read:
ls -la /mnt/lfcs-backup-test
Where a readable file is available, open or inspect it using a suitable command.
Next, attempt to create a temporary file:
touch /mnt/lfcs-backup-test/lfcs-readonly-test
This operation must fail because the export is read-only.
An illustrative error is:
Read-only file system
Even if the error wording differs, the important result is that write access is denied by the server.
Step 19: Clean up any test resources.
On the writing client, remove only the temporary verification file you created:
rm -f /mnt/lfcs-backup-test/lfcs-write-test
Unmount the temporary client mount:
sudo umount /mnt/lfcs-backup-test
Repeat the unmount on the other client.
Do not delete or alter actual backup files.
Step 20: Perform final verification on the NFS server.
Reconnect to the NFS server:
ssh lfcs00098
Verify the persistent configuration:
sudo grep '/srv/backup' /etc/exports
Expected:
/srv/backup lfcs00098nfs1(rw,sync,insecure) lfcs00098nfs2(ro,sync,insecure) Verify the active exports:
sudo exportfs -v
Confirm NFS service health:
systemctl is-active nfs-kernel-server
The final state must satisfy every requirement.
Requirement
Expected result
Exported directory
/srv/backup
Backup-storage client
lfcs00098nfs1
Backup-storage access
Read/write
Backup-restore client
lfcs00098nfs2
Backup-restore access
Read-only
insecure for first client
Present
insecure for second client
Present
Active exports
Correctly refreshed
NFS service
Active
Final Solution
The essential server-side commands are:
# Connect to the NFS server
ssh lfcs00098
# Check the export directory
ls -ld /srv/backup
# Examine existing exports
sudo cat /etc/exports
sudo exportfs -v
# Back up the configuration
sudo cp -a /etc/exports /etc/exports.bak
# Edit the exports file
sudo nano /etc/exports
Add or update the /srv/backup entry to read:
/srv/backup lfcs00098nfs1(rw,sync,insecure) lfcs00098nfs2(ro,sync,insecure) Save and execute:
# Apply changes
sudo exportfs -ra
# Verify active exports
sudo exportfs -v
# Confirm NFS service status
systemctl is-active nfs-kernel-server
# Verify persistent configuration
sudo grep '/srv/backup' /etc/exports
Technical Verification and References
The solution has been checked against the official Linux NFS manuals and Ubuntu Server documentation.
* Linux NFS exports(5) - Defines the export configuration syntax, rw, ro, sync and insecure options.
* Ubuntu Server - Network File System (NFS) - Documents the NFS server configuration and export- management procedure.
* Linux exportfs(8) - Documents reloading, managing and displaying active exports.
Video verification finding: Task 10 identifies the NFS server lfcs00098 and requires separate access modes for lfcs00098nfs1 and lfcs00098nfs2. The essential answer is the NFS export configuration above. Actual client access must be tested on the relevant systems; correct syntax alone does not establish that network connectivity and filesystem permissions are functioning.
Expected result: The NFS server exports /srv/backup to lfcs00098nfs1 with read/write access and to lfcs00098nfs2 with read-only access. Both client configurations explicitly include insecure, and the settings remain persistent in /etc/exports.
CORRECT TEXT
In which file, if present, must all users be listed that are allowed to use the cron scheduling system? (Specify the full name of the file, including path.)
In which file, if present, must all users be listed that are allowed to use the cron scheduling system? (Specify the full name of the file, including path.)
정답:
/etc/cron.allow