NO.57 The correct crontab entry to execute the script chklog three times per month between 3 p.m. and 5 p.m.:
* 3,4,5 1 * * chklog
3 3,4,5 1 * * chklog
3 15,16,17 * * * chklog
0 15,16,17 1 * * chklog
* 15,16,17 1 * * chklog
The correct crontab entry to execute the script chklog three times per month between 3 p.m. and 5 p.m. is: 3 15,16,17 * * * chklog The crontab entry has five fields that specify the time and frequency of the job, followed by the command or script to be executed. The fields are: * Minute: the minute of the hour when the job should run, from 0 to 59 * Hour: the hour of the day when the job should run, from 0 to 23 (in 24-hour format) * Day of month: the day of the month when the job should run, from 1 to 31 * Month: the month of the year when the job should run, from 1 to 12 * Day of week: the day of the week when the job should run, from 0 to 6 (where 0 and 7 are Sunday) The asterisk (*) means any value, and the comma (,) means a list of values. Therefore, the crontab entry above means: * Run the job at the 3rd minute of the hour * Run the job at the 15th, 16th, and 17th hour of the day (which are 3 p.m., 4 p.m., and 5 p.m.) * Run the job on any day of the month * Run the job on any month of the year * Run the job on any day of the week This will execute the script chklog three times per day, every day of the month, and every month of the year, which is equivalent to three times per month. The other options are incorrect because: * A. This will run the job at any minute of the hour, but only at the 3rd, 4th, and 5th hour of the day (which are 3 a.m., 4 a.m., and 5 a.m.), and only on the 1st day of the month. * B. This will run the job at the 3rd minute of the hour, but only at the 3rd, 4th, and 5th hour of the day * (which are 3 a.m., 4 a.m., and 5 a.m.), and only on the 1st day of the month. * D. This will run the job at the 0th minute of the hour (which is the top of the hour), but only at the 15th, 16th, and 17th hour of the day (which are 3 p.m., 4 p.m., and 5 p.m.), and only on the 1st day of the month. * E. This will run the job at any minute of the hour, but only at the 15th, 16th, and 17th hour of the day (which are 3 p.m., 4 p.m., and 5 p.m.), and only on the 1st day of the month. References: * Crontab Explained in Linux [With Examples] * ‘crontab’ in Linux with Examples – GeeksforGeeks * Linux Crontab Command Help and Examples – Computer Hope * Crontab in Linux with 20 Useful Examples to Schedule Jobs – TecAdmin * Linux crontab tutorial with Examples – Linux Tutorials – Learn Linux …
NO.58 What is a purpose of an SSH host key?
An SSH host key is a cryptographic key used for authenticating computers in the SSH protocol. Host keys are key pairs, typically using the RSA, DSA, or ECDSA algorithms. Public host keys are stored on and/or distributed to SSH clients, and private keys are stored on SSH servers. Each host (i.e., computer) should have a unique host key. Host keys are used for authentication towards the connecting client, analogous to user SSH keys. Host keys are generated using asymmetric encryption algorithms like RSA, DSA, or ECDSA algorithms12. When a client connects to the host, the host sends its public host key to the client, and the client verifies that the host key matches the one stored in its known hosts file. If the host key is unknown or has changed, the client will display a warning and prompt the user to accept or reject the host key. This is to prevent man-in-the-middle attacks, where an attacker intercepts the connection and pretends to be the legitimate host. The other options are either incorrect or irrelevant to the purpose of an SSH host key. References: * What is an SSH Host Key & How are They Configured?, What are SSH Host Keys? section * SSH Host Key Management Demystified, What are SSH host keys? section * What is SSH host key – omnisecu.com, first paragraph
NO.62 Which command included in NetworkManager is a curses application which provides easy acces to the NetworkManager on the command line? (Specify only the command without any path or parameters.)
nmtui Explanation: The command nmtui is a curses application that provides easy access to the NetworkManager on the command line. It is included in the networkmanager package, along with nmcli, which is another command line interface for NetworkManager. nmtui allows the user to view, edit, activate and deactivate network connections, as well as set the system hostname. It has a simple and user-friendly interface that can be navigated with the keyboard or mouse12. References: 1: Wireless Network Manager command line ncurses GUI. 2: NetworkManager – ArchWiki.
NO.67 You need to pause the CUPS printer HPLaserjet4, and you want to cancel all print jobs with a message, “hello”. Which command will do this?
The command cupsdisable -c -r hello HPLaserjet4 will pause the CUPS printer HPLaserjet4 and cancel all print jobs with a message, “hello”. The cupsdisable command is used to stop printers and classes, while the cupsenable command is used to start them. The -c option cancels all jobs on the named destination, and the -r option sets the message associated with the stopped state. The message will be displayed to the users who try to print to the paused printer. For example, the output of lpstat -p HPLaserjet4 after running the command will show: printer HPLaserjet4 disabled since Wed 23 Jun 2023 11:54:03 AM UTC – hello The other options are not correct. The cupsreject command is used to reject or accept jobs for a printer or class, not to pause or resume them. The -p and -m options are not valid for either cupsdisable or cupsreject. The correct syntax for cupsreject is: cupsreject [ -E ] [ -U username ] [ -h server [:port] ] [ -r reason ] destination (s) The -E option forces encryption of the connection to the server, the -U option uses the specified username when connecting to the server, the -h option uses the specified server and port, and the -r option sets the message associated with the rejecting state123. References: 1: cupsdisable(8) – Linux manual page 2: cupsreject(8) – Linux manual page 3: CUPS Administration – Page: 1.4 – Seite 3 Raspberry Pi Geek
NO.69 Which of the following commands should be added to /etc/bash_profile in order to change the language of messages for an internationalized program to Portuguese (pt)?
The LC_MESSAGES environment variable specifies the language to use in diagnostic messages for an internationalized program. It can be set to any value supported by the installation, such as pt for Portuguese, en for English, fr for French, etc. The LC_MESSAGES variable can be set either globally in a shell profile file, such as /etc/bash_profile, or locally in a shell session. For example, to set the language of messages to Portuguese for the current shell session, one can use the following command: export LC_MESSAGES=pt To verify the change, one can run an internationalized program, such as man, and see the output in Portuguese. The LC_MESSAGES variable can also be used to run a single command with a different language without affecting the system’s language. For example, to run the man command with the Spanish language, one can use the following syntax: LC_MESSAGES=es man The LC_MESSAGES variable is useful for testing how programs behave in different languages or for displaying messages in different languages1234. References: * Locale Environment Variables in Linux | Baeldung on Linux * Linux / UNIX: TZ Environment Variable – nixCraft * Changing your locale on Linux and UNIX systems – IBM * Selecting message language in gcc and g++ – Stack Overflow
NO.70 Which of the following IPv4 networks are reserved by IANA for private address assignment and private routing? (Choose THREE correct answers.)
According to the RFC 19181, the Internet Assigned Numbers Authority (IANA) has reserved the following three blocks of the IPv4 address space for private internets: * 10.0.0.0 – 10.255.255.255 (10/8 prefix) * 172.16.0.0 – 172.31.255.255 (172.16/12 prefix) * 192.168.0.0 – 192.168.255.255 (192.168/16 prefix) These address blocks are not globally routable and are intended for use within private networks, such as home, office, or campus networks. They can be assigned to any device that does not need to communicate directly with the public internet, or that can use network address translation (NAT) to do so. Private addresses allow for more efficient use of the limited IPv4 address space and reduce the need for public addresses. The other options are not reserved for private use by IANA. Option A, 127.0.0.0/8, is reserved for loopback addresses, which are used to refer to the local host. Option C, 169.255.0.0/16, is a typo and should be 169.254.0.0/16, which is reserved for link-local addresses, which are used for automatic address configuration on a local network segment. Option F, 224.0.0.0/4, is reserved for multicast addresses, which are used for one-to-many communication. References: * RFC 1918: Address Allocation for Private Internets – RFC Editor * IANA IPv4 Special-Purpose Address Registry * Private network – Wikipedia