LPIC-1 System Administrator Exam 102, Part 2 of 2, version 5.0 102-500 Exam Practice Test

Page: 1 / 14
Total 234 questions
Question 1

Which of the following are syslog facilities? (Choose TWO correct answers.)



Answer : A

https://learning.lpi.org/en/learning-materials/102-500/108/108.2/

The syslog facilities are predefined categories of messages that can be used to classify the source and type of the log events12.The syslog facilities are defined by the syslog protocol and are standardized across different implementations of syslog12. The syslog facilities are:

auth: Security and authorization messages, such as login failures or sudo usage12.

authpriv: Same as auth, but used for private security messages that should not be available to all users12.

cron: Messages from the cron daemon, such as scheduled jobs or errors12.

daemon: Messages from system daemons, such as sshd or ntpd12.

kern: Messages from the kernel, such as boot messages or hardware errors12.

lpr: Messages from the line printer subsystem, such as print jobs or errors12.

mail: Messages from the mail subsystem, such as sendmail or postfix12.

news: Messages from the network news subsystem, such as news servers or clients12.

syslog: Messages generated internally by the syslog daemon, such as configuration errors or restarts12.

user: Messages from user-level processes, such as applications or scripts12.

uucp: Messages from the Unix-to-Unix copy subsystem, such as file transfers or errors12.

local0 to local7: Custom facilities that are not used by any system processes and can be assigned to user applications or scripts123.

Therefore, the correct answers are A. local7 and B. mail, as they are both valid syslog facilities. The other options are not syslog facilities and are either made up (C. advanced and E. remote) or refer to a specific process rather than a category of messages (D. postmaster).


Question 2

Which of the following options in the chrony configuration file define remote lime sources? (Choose TWO correct answers.)



Answer : D, E


Question 3

Fill in Blanks

An administrator wants to determine the geometry of a particular window in X, so she issues the __________ -metric command and then clicks on the window.



Answer : A

The xwininfo command is a utility for displaying information about windows in X. It can show various attributes of a window, such as its location, size, depth, border width, visual class, colormap, map state, and event masks. The -metric option specifies that all dimensions should be displayed in metric units (millimeters) rather than pixels. By issuing the xwininfo -metric command and then clicking on a window, the administrator can determine the geometry of that window, including the decorations, in millimeters.Reference:

xwininfo(1) --- Arch manual pages

[command line -


Question 4

Which of the following commands can identify the PID od a process which opened a TCP port?



Answer : D

The lsof command, meaning list open files, is a command-line utility in the Linux system to display information about files that are opened by processes1. The lsof command can take various options and arguments to filter and format the output. One of the options that can be used to identify the PID of a process which opened a TCP port is the -i option, which selects the listing of files whose Internet address matches the specified address. The address can be specified as a port number, a host name, or a combination of both. For example, to list the processes that are listening on TCP port 80, one can run:

lsof -i TCP:80

The output shows the command name, the PID, the user name, the file descriptor, the type, the device, the size/off, the node, and the name for each process. The name column shows the local and remote addresses and port numbers for the TCP connection. For example, the output may look like:

COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME httpd 1234 root 4u IPv4 12345 0t0 TCP *:80 (LISTEN) httpd 2345 www-data 4u IPv4 12345 0t0 TCP *:80 (LISTEN) httpd 3456 www-data 4u IPv4 23456 0t0 TCP 192.168.1.10:80->192.168.1.20:1234 (ESTABLISHED)

This shows that the httpd command, which is the Apache web server, is listening on TCP port 80 with the PID 1234 and 2345, and has an established connection with the remote address 192.168.1.20 and port 1234 with the PID 3456. To kill the process by PID, one can use the kill command with the -SIGTERM option, which sends a termination signal to the process. For example, to kill the process with the PID 3456, one can run:

kill -SIGTERM 3456

The other options are not correct because:

ptrace: This is not a command, but a system call that allows a process to trace and control the execution of another process.It is used by debuggers and other tools that need to monitor and manipulate the behavior of other processes2. It does not display the PID of a process which opened a TCP port.

strace: This is a command that traces the system calls and signals of a process.It can be used to diagnose, debug, and monitor the interaction between a process and the kernel3. It does not display the PID of a process which opened a TCP port.

debug: This is not a command, but a general term that refers to the process of finding and fixing errors in a program or system.There are various tools and methods that can be used for debugging, such as debuggers, loggers, profilers, etc4. It does not display the PID of a process which opened a TCP port.

nessus: This is a command that runs the Nessus vulnerability scanner, which is a tool that scans a network or a system for security flaws and potential attacks5. It does not display the PID of a process which opened a TCP port.Reference:

https://www.howtogeek.com/28609/how-can-i-tell-what-is-listening-on-a-tcpip-port-in-windows/

https://bing.com/search?q=identify+PID+of+process+that+opened+a+TCP+port


Question 5

Which file contains a set of services and hosts that will be allowed to connect to the server by going through a TCP Wrapper program such as tcpd? (Specify the full name of the file, including path.)https://lh3.googleusercontent.com/-5cd-clmKnbk/AAAAAAAAAAI/AAAAAAAAADM/-SXesH19Ido/s46-c-k-no/photo.jpg



Answer : A

The /etc/hosts.allow file contains a set of rules that specify which services and hosts are allowed to connect to the server by going through a TCP Wrapper program such as tcpd. TCP Wrappers are a security mechanism that can filter incoming requests based on the source address, destination address, and service name. TCP Wrappers can also perform logging, redirection, and execution of commands based on the rules.

The /etc/hosts.allow file has the following format:

service_list : host_list [ : option_list ]

The service_list is a comma-separated list of service names, such as sshd, telnet, or ftp. The host_list is a comma-separated list of host names, IP addresses, or network masks that are allowed to access the services. The option_list is an optional list of keywords that can modify the behavior of the rule, such as twist, spawn, deny, or allow.

For example, the following rule in /etc/hosts.allow allows ssh access from any host in the 192.168.1.0/24 network, and logs the connection attempt:

sshd : 192.168.1.0/255.255.255.0 : spawn /bin/echo %a from %h attempted to access %d >> /var/log/sshd.log

The /etc/hosts.allow file is processed before the /etc/hosts.deny file, which contains the rules for denying access to the server. If a request matches a rule in /etc/hosts.allow, it is granted access and the processing stops. If it does not match any rule in /etc/hosts.allow, it is checked against the rules in /etc/hosts.deny. If it matches a rule in /etc/hosts.deny, it is denied access and the processing stops. If it does not match any rule in either file, it is granted access by default.


LPI 102-500 Exam Objectives, Topic 110.3: Implement host security

LPI 102-500 Study Guide, Chapter 10: Securing Your System, Section 10.3: TCP Wrappers

hosts.allow man page

Question 6

Which of the following commands can be used to convert text files in one character encoding to another character encoding?



Answer : D

The command that can be used to convert text files in one character encoding to another character encoding is:

iconv: this command can convert text files from one form of encoding to another, such as UTF-8, ISO-8859-1, ASCII, etc. To use this command, you need to specify the input encoding, the output encoding, and the file name. For example, to convert a file named input.txt from ISO-8859-1 to UTF-8, you can run:

iconv -f ISO-8859-1 -t UTF-8 input.txt

The output will be printed to the standard output, which can be redirected to another file or piped to another command. You can also use the-ooption to specify the output file name. For example, to convert the same file and save the output to output.txt, you can run:

iconv -f ISO-8859-1 -t UTF-8 -o output.txt input.txt

To list all the supported encodings, you can use the-loption. For example, to see all the encodings that start with UTF, you can run:

iconv -l | grep UTF

The iconv command is part of the GNU libc package and is available on most Linux systems. The full path of the command is/usr/bin/iconv.

The other options are incorrect because:

cat: this command can concatenate and print files to the standard output, but it does not perform any encoding conversion. It can be used to display the contents of a text file, but it will not change the encoding of the file.

convert: this command can convert image files from one format to another, such as PNG, JPEG, GIF, etc. It is part of the ImageMagick suite of tools and is not related to text encoding conversion.

dd: this command can copy and convert data from one source to another, such as files, devices, or pipes. It can perform some conversions, such as changing the case of letters, swapping bytes, or converting between ASCII and EBCDIC, but it does not support common text encodings such as UTF-8 or ISO-8859-1.

utf2utf: this is not a valid command on Linux. There is no such tool that can convert between different UTF encodings.


How to Convert Files to UTF-8 Encoding in Linux - Tecmint

Best way to convert text files between character sets? - Stack Overflow

how to change encoding of a text file without openning the file in shell program - Stack Overflow

HowTo: Check and Change File Encoding In Linux - ShellHacks

How to change character encoding of a text file on Linux - Xmodulo

Topic 4, Essential System Services

Question 7

What is the purpose of the iconv command?



Answer : E

The iconv command is used to convert the encoding of a file from one character set to another. A character set is a collection of characters that are assigned numerical values called code points. Different character sets may use different numbers of bytes to represent each character, and may have different mappings of code points to characters. For example, ASCII is a single-byte character set that encodes 128 characters, while UTF-8 is a variable-length character set that can encode over a million characters. The iconv command can convert between many different character sets, such as ASCII, UTF-8, ISO-8859-1, etc. The basic syntax for using the command is as follows:

iconv [options] -f from-encoding -t to-encoding input-file > output-file

The -f option specifies the encoding of the input file, and the -t option specifies the encoding of the output file. The input file is read from standard input, and the output file is written to standard output, unless specified otherwise.The iconv command can also list all the supported character sets with the -l option1234.Reference:

How To Use the iconv Command on Linux - How-To Geek

iconv command in Linux with Examples - GeeksforGeeks

iconv - convert file encoding from one character set to another | Linux ...

Using iconv to change character encodings - FileFormat.Info


Page:    1 / 14   
Total 234 questions