Which configuration file would be edited to change default options for the OpenSSH server?
What command will display the group names and GIDs to which a user belongs? (Provide only the command name with or without path information)
Answer : A
Theidcommand will display the user ID (uid), the primary group ID (gid), and the supplementary groups (groups) of a user. The output will show the names and the numerical IDs of the groups. For example:
id linuxize
The command will show the user ID (uid), the user's primary group (gid), and the user's secondary groups (groups)
uid=1001(linuxize) gid=1001(linuxize) groups=1001(linuxize),27(sudo)
To print only the names instead of the numbers use the-noption.
id -nG linuxize
The command will show only the names of the groups
linuxize sudo
Theidcommand is part of the GNU coreutils package and is available on all Linux systems. The full path of the command is/usr/bin/id.Reference:
How to List Groups in Linux | Linuxize
Which of the following commands shows all active systemd timers?
Answer : D
The command systemctl list-timers shows all active systemd timers, which are units that can be used to schedule the execution of other units at specific times or after certain intervals. The output of the command includes the following columns:
NEXT: The next time the timer will trigger.
LEFT: The time left until the next trigger.
LAST: The last time the timer triggered.
PASSED: The time passed since the last trigger.
UNIT: The name of the timer unit.
ACTIVATES: The name of the unit that is activated by the timer.
For example, the following output shows two active timers: apt-daily.timer and apt-daily-upgrade.timer, which are used to perform automatic updates on Debian-based systems.
NEXT LEFT LAST PASSED UNIT ACTIVATES Mon 2021-11-15 06:00:00 UTC 9h left Sun 2021-11-14 06:00:01 UTC 20h ago apt-daily.timer apt-daily.service Mon 2021-11-15 06:23:51 UTC 9h left Sun 2021-11-14 06:23:51 UTC 20h ago apt-daily-upgrade.timer apt-daily-upgrade.service 2 timers listed.
The other commands in the options are either invalid or unrelated to systemd timers:
systemctl-timer show is not a valid command. To show the details of a specific timer unit, the command systemctl show unit.timer can be used, where unit is the name of the unit that is activated by the timer.
timectl list is not a valid command. To list the available time zones, the command timedatectl list-timezones can be used. To list the current time and date settings, the command timedatectl can be used without any arguments.
systemctl -t is not a complete command. To list all units of a specific type, the command systemctl -t type can be used, where type is the name of the unit type, such as service, timer, socket, etc.
timeq is not a valid command. It may be confused with the time command, which measures the time taken by a command or program to execute.
Which of the following commands can be used to limit the amount of memory a user may use?
Answer : C
The ulimit command can be used to limit the amount of memory a user may use. The ulimit command is a shell builtin that allows the user to view or modify the resource limits imposed by the operating system. The resource limits can affect the maximum size of files, the maximum number of processes, the maximum amount of CPU time, and the maximum amount of virtual memory a user can access.
To limit the amount of memory a user may use, the -v option can be used with the ulimit command. The -v option sets the maximum amount of virtual memory available to the current shell and its children in kilobytes. For example, the command ulimit -v 1000000 would limit the virtual memory to 1 GB. The -m option can also be used to set the maximum resident set size, which is the amount of physical memory used by a process, but this option is not supported by all systems.
The ulimit command can be used interactively in a shell session, or it can be placed in a shell initialization file, such as .bashrc or .profile, to apply the limits to all future shell sessions. The ulimit command can also be used in conjunction with the /etc/security/limits.conf file, which allows the system administrator to set global or per-user resource limits for all users and processes. The /etc/security/limits.conf file can specify hard and soft limits for each resource, as well as the scope of the limit, such as user, group, or domain.
The other commands listed are not related to limiting the amount of memory a user may use. The umask command sets the default file permissions for newly created files and directories. The usermod command modifies the user account information, such as the home directory, the login shell, or the password expiration date. The passwd command changes the user password. The chage command changes the password aging information, such as the minimum and maximum number of days between password changes, or the number of days before the password expires.Reference:
How to limit user environment with ulimit Linux command
Control server access using hosts.allow and hosts.deny files
Where are user specific crontabs stored?
Answer : B
The user-specific crontab files are stored in the /var/spool/cron/crontabs directory, where each file is named after the username of the owner. These files are not meant to be edited directly, but rather through the crontab command. The other options are either incorrect or non-existent locations for user crontab files.Reference:
Where is the user crontab stored?
crontab running as a specific user
Where is the User Crontab Stored?
With IPv6, how many bits have been used for the interface identifier of an unicast address? (Specify the number using digits only.)
When trying to unmount a device it is reported as being busy. Which of the following commands could be used to determine which process is causing this?
Answer : B
The lsof command stands forlist open files, and it can be used to show which processes have opened files on a device or mount point. This can help to identify which process is causing a device to be busy and prevent it from being unmounted. The syntax of the lsof command is:
lsof [options] [file|directory|device]
For example, to list the processes that have opened files on the /dev/sda1 device, the command would be:
lsof /dev/sda1
The output of the lsof command will show the process ID (PID), the user name, the command name, the file descriptor, the file type, the device number, the file size, the node number, and the file name for each open file. The file descriptor column can indicate the mode of access, such as r for read, w for write, u for read and write, and - for unknown.
The other options in the question are not relevant for this task. The debug command is used to examine and modify the memory of a running process. The nessus command is used to launch the Nessus vulnerability scanner. The strace command is used to trace system calls and signals of a process. The traceroute command is used to display the route and measure the transit delays of packets across a network.
LPI 102-500 Exam Objectives, Topic 104.3: Manage file permissions and ownership