General CompTIA Linux+ Questions Flashcards

This is a bunch of questions that cover a lot of knowledge I expect to be on the CompTIA Linux+ exam. (600 cards)

1
Q

What order are the Bash shell config files introduced upon login? (Pgs. 83-84)

A

/etc/profile, ~/.bash_profile, ~/.bashrc, /etc/bashrc

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What do each of the Bash config files generally do? (Pgs. 83-84)

A

/etc/profile – Sets main environment variables. HOSTNAME, MAIL, etc.
~/.bash_profile – Sets user-defined environment variables. Also, EDITOR, PATH, etc.
~/.bashrc – Sets user-defined runtime variables and aliases.
/etc/bashrc – Sets main runtime variables. SHELL, PS1 (Command Prompt configuration), etc.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How would you set the date on a Linux system? (Pg. 82)

A

Example: timedatectl set-time 2023-01-01

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How do you set the time zone with the timedatectl command? (Pgs. 81-82)

A

Example: timedatectl set-timezone America/New_York – This sets the system time zone (/etc/localtime) to the time zone “America/New_York.”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the four attributes for a file/directory in ls -Z per SELinux? (Pg. 558)

A

user (_u), role (_r), type (_t), sensitivity level (s0)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How do you add a secondary group without deleting any groups present with usermod? (Pg. 110)

A

usermod -aG <group_name> -- (-aG) Adds a secondary group (without replacing original(s).</group_name>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How do you change a username with usermod? (Pg. 110)

A

usermod -l <new_user_name><old_user_name> – (-l) Renames the username (a.k.a., login name) for a user.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

And how do you rename a user and move their home directory to a new user with usermod? (Pg. 110)

A

usermod -l <new_user_name> -d <new_home_dir> -m <old_user_name> – (-m) Moves the user’s home directory to being a new user’s home directory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is Samba (Pgs. 472-473)?

A

Samba is a remote access tool to Windows file and print services for Linux.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does OOM stand for? (Pg. 612)

A

“Out Of Memory Killer”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What does the OOM process generally do? (Pg. 612)

A

When memory is critically low for a system, the OOM process kills processes with high memory utilization. The processes to be killed are chosen based on a severity score for memory utilization determined by OOM, where the highest severity score is killed. Core system processes are given low severity scores.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What does lsof mean? (Pg. 228)

A

“lsof” = “LiSt Open Files”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What flag do you need for lsof to check open network ports? (Pg. 503)

A

lsof -i – This will list network services and their ports.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What does pwconv generally do?

A

pwconv – This command converts the /etc/passwd file to a /etc/shadow file.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How do you create and decrypt an encrypted cpio file? (Pg. 233)

A

cpio -ov > [output dump file name] – Creates an encrypted dump (usually piped onto a command defines the file).
cpio -iv < [input dump file name] – Decrypts the encrypted dump.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What does mtr stand for? (Pg. 466)

A

“mtr” = “My TraceRoute”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Which two commands does mtr copy and combine in functionality? (Pg. 466)

A

It combines traceroute and ping, scanning the network path a packet takes and checking packet transmission to an external server.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

How many properties are there in /etc/shadow? (Pgs. 102-103)

A

There are 8 properties.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What are the properties of /etc/shadow? (Pgs. 102-103)

A

user_name, password, last_modified, min_days, max_days, warn_days, inactive (measured in days), expire

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Why might a user not be able to save their work on a filesystem?

A

The filesystem was mounted in read-only mode. Example: mount -o ro /public
To undo: mount -o remount,rw /public

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Blacklisting the module disables the module, but how do you prevent a module from being installed?

A

Do this: echo “blacklist joydev” >> /etc/modprobe.d/blacklist.conf – Blacklists the module.
And this: echo “blacklist joydev” >> /etc/modprobe.d/network.conf – Blacklists the module in the network config.
BUT ALSO: echo “install joydev /bin/false” >> /etc/modprobe.d/blacklist.conf – Prevents the module from being installed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

How are RADIUS and TACACS+ used, simply?

A

RADIUS and TACACS+ use a modem to proxy to a separate server to authenticate a user. TACACS+ furthers RADIUS by incorporating password encryption.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

How do you determine the IP address subnet mask from the CIDR number?

A

Each number of an IP address is an octet of binary digits. Mark a ‘1’ from the left going right for the CIDR number of spaces to determine the subnet address. For instance a subnet:
/22 = 11111111.11111111.11111100.00000000 = 255.255.252.0

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

How do you display all addresses with the ip command? (Pgs. 450-451)

A

ip addr show – Displays all network interface addresses.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
How do you add an address to a device with the ip command? (Pgs. 450-451)
ip addr add dev -- Adds an address to a device.
26
How do you delete an address with the ip command? (Pgs. 450-451)
ip addr del dev -- Deletes an address from a device.
27
How do you add a route with the ip command? (Pg. 457)
ip route add via dev -- Adds a network route.
28
How do you display statistics per an IP or MAC address, for instance, with the ip command? (Online)
ip -s addr OR ip -s link -- The “-s” option can be used to display statistics for a network entity like IP addresses or MAC addresses, respectively.
29
What do “link,” “inet,” “inet6,” and “brd” refer to in an ip command? (Pg. 451)
IP Terms: - “link” = MAC address of the network board. - “inet” = IPv4 address and subnet mask assigned to an interface. - “inet6” = IPv6 address and subnet mask assigned to an interface. - “brd” = Broadcast address of the network segment.
30
What do the BOOTPROTO, IPADDR, NETMASK, and BROADCAST attributes of a /etc/sysconfig/network-scripts interface file specify? (Pg. 452)
BOOTPROTO -- Specifies whether the network interface has a static or dynamic (DHCP) addressing scheme. IPADDR -- Specifies the base address for a network interface. NETMASK -- Specifies the network mask for a network interface. BROADCAST -- Specifies the broadcast address for a network interface.
31
What do /etc/nsswitch.conf and /etc/resolv.conf each do? (Pg. 459)
/etc/nsswitch.conf -- (Name Service Switch) The file designates the order in which name servers will be used to search for name resolution. It also defines which name servers to use for specific service types. /etc/resolv.conf -- The file resolves the hostnames of name servers to their IP addresses.
32
What is the real DNS configuration file through systemd which replaces /etc/resolv.conf? (Online)
/etc/systemd/resolved.conf -- This configures the DNS for a system and defines IP addresses for DNS servers.
33
In modern systems, how should you edit the DNS configuration for systemd-resolved? (Percipio Video and Online Lab)
The /etc/systemd/resolved.conf file can be edited by creating a configuration file either under /etc/systemd/resolved.conf.d/* or /etc/netplan/*, depending on the distro.
34
What does PAM stand for? (Pgs. 536-537)
"PAM" = "Pluggable Authentication Modules"
35
What is the PAM configuration directory? (Pgs. 536-537)
/etc/pam.d
36
What are the three columns of a PAM config file? (Pgs. 536-537)
Authentication Tasks, Control Keyword, Module (.so)
37
What are the main PAM authentication tasks? (Pgs. 536-537)
List of Authentication Tasks: account -- Requests account verification services (e.g., whether password has expired). auth -- Authenticates a user, request a password, and set up credentials. password -- User must insert a password. session -- Designates settings for a service session.
38
What are the main PAM control keywords? (Pgs. 536-537)
List of Control Keywords: required -- If fails, operation fails after running through all other modules. requisite -- If fails, operation fails immediately. sufficient -- If succeeds, that is enough for the operation to succeed. optional -- If fails, operation is okay, unless it is the only module in the stack.
39
How do you change your password with the passwd command? (Pgs. 108-109)
passwd -- Brings up dialog to change password.
40
How do you lock an account with the passwd command? (Pgs. 108-109)
passwd -l -- Locks user account.
41
How do you set minimum days with the passwd command? (Pgs. 108-109)
passwd -n <#> -- Sets the minimum number of days before password change.
42
How do you set maximum days with the passwd command? (Pgs. 108-109)
passwd -x <#> -- Sets the maximum number of days before password expiration.
43
How do you set warn days with the passwd command? (Pgs. 108-109)
passwd -w <#> -- Sets the number of warn days before password expiration.
44
How do you set inactive days for password expiration with the passwd command? (Pgs. 108-109)
passwd -i <#> -- Sets the number of days account is accessible after password expiration.
45
How do you display all password aging information with the passwd command? (Pg. 109)
passwd -S -- Displays all password aging information. (Equivalent to chage -l .)
46
What are the two main config files for GRUB? (Pg. 336)
/etc/default/grub (default variables for configuring GRUB2) and /boot/grub2/grub.cfg (GRUB2's main config file)
47
In /etc/default/grub, what are GRUB_TIMEOUT and GRUB_DEFAULT? (Pg. 336)
Variables in /etc/default/grub: GRUB_TIMEOUT -- The time (in seconds) allowed before GRUB selects the default OS to boot. GRUB_DEFAULT -- The default OS to boot for a system.
48
How do you see the boot messages using journalctl? (Pgs. 550-551)
journalctl -b <#> -- Lists the boot messages from the # boot for the system. Positive number is the first nth boot of Linux. Negative number is the last nth boot of Linux. (Negative is probably more useful.)
49
How do you see logs for a specific service using journalctl? (Pgs. 550-551)
journalctl -u -- Lists the journal log messages for the specified service.
50
What are the two components of a Git config for a repository, of which are required for a commit? (Pg. 579)
user.name and user.email
51
How do you initiate the emergency target with systemctl?
systemctl emergency
52
How do you add or delete a route with the route command? (Pgs. 456-457)
route add -net \ netmask \ gw \ -- Add a gateway route. route del -net \ netmask \ gw \ -- Delete a gateway route.
53
How do you add a default gateway with the route command? (Pgs. 456-457)
route add default gw -- Adds a default gateway.
54
What does netstat show and what are its main arguments? (Pg. 464)
Lists network connections (-a for all), routing table (-r), and network interface information (-i).
55
What command is supposed to replace the netstat command? (Pg. 464)
"ss" = "Show Sockets"
56
How do you display all sockets with the ss/netstat command? (Pg. 464)
ss -a OR netstat -a -- This displays all listening and nonlistening sockets on the network.
57
How do you display statistics for the network interfaces with the netstat command? (Pg. 464)
netstat -i -- This displays statistics on network interfaces.
58
How do you display the routing table with the netstat command? (Pg. 464)
netstat -r -- This displays the routing table for a network.
59
How do you display all listening TCP sockets with the ss/netstat command? (Online and Online)
ss -lt OR netstat -lt -- This displays all of the actively listening TCP sockets on the network. (“-l” = Listening; “-t” = TCP)
60
How do you display a summary of network connection statistics with the ss/netstat command? (Online and Online)
ss -s OR netstat -s -- This displays a summary of the connections per protocol (total UDP, TCP, INET, etc.).
61
How do you add the immutability attribute to a file with the chattr command? (Pg. 175)
chattr +i -- Adds immutable attribute.
62
How do you add the file compression attribute to a file with the chattr command? (Pg. 175)
chattr +c -- Adds compressed attribute.
63
How do you add the journaling attribute with the chattr command? (Pg. 175)
chattr +j -- Adds data journaling attribute.
64
How do you add the synchronous updates attributes with the chattr command? (Pg. 175)
chattr +s -- Adds synchronous updates attribute.
65
Who can delete a file with an immutable attribute set (done by chattr)? (Pg. 175)
No one can delete the file. You would have to do a chattr -i to remove the immutability.
66
What is Upstart, in simple terms?
An alternative initialization system (versus init) that allows for asynchronous initialization of processes, rather than the traditional, forced synchronous order.
67
How many fields are there in /etc/fstab? (Pg. 205)
There are 6 fields.
68
What are the fields of /etc/fstab? (Pg. 205)
device/partition, directory mount point, filesystem type, mount options, filesystem should be backed up with dump?, order of fsck on reboot
69
What order number should the root partition (/) have in the /etc/fstab table? (Pg. 205)
Root should have an order number of 1.
70
What is the order number for non-root, non-swap partitions in the /etc/fstab table? (Pg. 205)
Other partitions should have an order number of 2. (Swap partitions can be a 0.)
71
What are distinguishing features for: ext3, ext4, xfs, btrfs, reiserfs, nfs, ntfs? (Pg. 198)
ext3 -- Common journaled filesystem. ext4 -- Common journaled filesystem with support for larger volumes and files than ext3. xfs -- Journaled filesystem that uses parallel I/O. btrfs -- Journaled filesystem and default filesystem for SUSE. reiserfs -- Journaled filesystem. Predecessor to btrfs. nfs -- Allows filesystem access over a network. (NOT JOURNALED!) ntfs -- Journaled filesystem related to Microsoft. Microsoft's New Technology File System (NTFS).
72
How do you define the type of filesystem with mkfs? (Pg. 198)
mkfs -t OR mkfs. -- This will mount a specified filesystem to a partition.
73
How do you add a journaling filesystem with mke2fs?
mke2fs -j -- Adds a journaling filesystem to a partition.
74
How do you add a label with tune2fs? (Pgs. 199-200)
tune2fs -L
75
How do you add a journaling filesystem to ext2 with tune2fs? (Pg. 200)
tune2fs -j -- Adds a journaling filesystem to a partition.
76
How do you set the number of mounts after which a filesystem is automatically checked by fsck with the tune2fs command? (Pg. 200)
Example: tune2fs -c 3 /dev/sdb1 -- This states that after 3 mounts the specified partition “/dev/sdb1” must be checked by fsck.
77
How do you set the reserved block percentage for a filesystem with the tune2fs command? (Pg. 200 and Online)
Example: tune2fs -m 5 /dev/sdb1 -- This states that 5% of the specified partition “/dev/sdb1” must be reserved for the root user to help clean up full disk drives.
78
How do you specify the fsck time interval check for a filesystem with the tune2fs command? (Pg. 200 and Online)
Example: tune2fs -i 2w /dev/sda5 -- This states that the specified partition “/dev/sda5” must be checked by fsck on 2-week intervals. (Other Examples: “30d” = 30 days and “4m” = 4 months)
79
How do you specify the default error behavior for fsck when a filesystem error is detected with the tune2fs command? (Online)
tune2fs -e -- This specifies that when an error is detected for a filesystem, it should do one of the following.: - continue -- Continue normal execution. - remount-ro -- Remount the filesystem in read-only mode. - panic -- Go into kernel panic.
80
How do you delete a user's record just from /etc/passwd and /etc/shadow with the userdel command? (Pg. 110)
userdel -- This deletes the specified userid, just removing their /etc/passwd and /etc/shadow entries.
81
How do you fully delete a user, with their home directory, jobs, and mail, with the userdel command? (Pg. 110)
userdel -r -- This wholly deletes the specified userid, removing their directory, jobs, and mail.
82
What are the main directory and config file for time zones and what do they each define? (Pg. 80)
Time Zone Config Files: /usr/share/zoneinfo Directory -- Contains a number of binary files with worldwide time zones. /etc/localtime -- From the /usr/share/zoneinfo, a file is set to this file to set the system's time zone.
83
What is an example of setting a local locale setting? (Pg. 78)
Example: localectl set-locale LANG=en_US.UTF-8 -- Sets the locale and keyboard settings to US English/UTF-8.
84
How do you display the current locale setting? (Pg. 78)
localectl status -- Lists the current locale setting on the Linux system.
85
How do you list out the available locale settings? (Pg. 78)
localectl list-locales -- Lists available locale settings.
86
What is the standard, full permission set for files? (Pg. 169)
0666 -- For a file, read and write permissions for user, group, and other.
87
What is the standard, full permission set for directories? (Pg. 169)
0777 -- For a directory, read, write, and execute permissions for user, group, and other.
88
What is the default umask? (Pgs. 170-171)
0022 -- The default umask is to remove the write permissions from group and other users.
89
How do you set the umask? (Pgs. 170-171)
Example: umask 0033 -- Removes write and execute permissions for files and directories for group and other users.
90
What does the command "df" show, in general? (Pgs. 207-208)
It shows the amount of disk space still free under the system's disk partitions.
91
What does "df" stand for? (Pgs. 207-208)
"df" = "Disk Free"
92
What argument of the df command prints the results in a readable format? (Pgs. 207-208)
df -h -- Human-readable format (an essential argument).
93
What argument of the df command prints the results by file type? (Pgs. 207-208)
df -T -- Displays filesystem type for each partition.
94
What argument of the df command prints the results by remaining inodes? (Pgs. 207-208)
df -i -- Displays remaining inodes for each partition.
95
What does the command "du" show, in general? (Pgs. 208-209)
It shows the amount of space used under a directory.
96
What does "du" stand for? (Pgs. 208-209)
"du" = "Directory Usage"
97
What argument of the du command prints the results in a readable format? (Pgs. 208-209)
du -h -- Human-readable format (an essential argument).
98
What argument of the du command prints the total usage of a directory? (Pgs. 208-209)
du -c -- Calculates the total disk space usage for a directory.
99
What argument of the du command prints the total usage summary (without subdirectory listing)? (Pgs. 208-209)
du -s -- Prints a summary of disk space usage for a directory. (Does not list total for subdirectories.)
100
What is mq-deadline? (Pgs. 210-211)
mq-deadline is a job scheduler which sorts I/O requests in batches. It is useful for virtualized guest users.
101
What is the config file for setting a scheduler? (Pgs. 210-211)
/sys/block/sda/queue/scheduler -- Defines the scheduler for a system ("sda" could be a different disk name).
102
What does "mdadm" stand for? (Pgs. 238-239)
"mdadm" = "Meta-Device ADMinistrator"
103
What is an example meta-device? (Pgs. 238-239)
/dev/md0 -- The first meta-device on a system.
104
What is an example of RAID disk creation with the mdadm command? (Pgs. 238-239)
mdadm -C /dev/md0 \--level=1 \--raid-disks=2 /dev/sdb /dev/sdc -- This creates a RAID Level 1 array out of two disks (/dev/sdb and /dev/sdc). The meta-device /dev/md0 is created out of this action.
105
How do you see the description of a RAID meta-device with the mdadm command? (Pgs. 238-239)
mdadm - -detail \ -- Displays the details of the meta-device.
106
How do you make a RAID filesystem permanent? (Pgs. 238-239)
Add the meta-device filesystem to the filesystem table /etc/fstab.
107
What is virsh? (Pg. 591)
virsh is used to manage virtual machine hypervisors on Linux. This is specifically a Red Hat-based tool.
108
How do you list all available domains with virsh? (Found Online)
virsh list \--all -- Lists all available VM domains.
109
How do you start up a VM with virsh? (Found Online)
Example: virsh start test -- Starts up the VM "test."
110
How do you shutdown a VM with virsh? (Found Online)
Example: virsh shutdown test -- Shuts down the VM "test."
111
How do you define an escape character sequence? (Pg. 49)
Example: virsh \--escape ^[ -- Sets "^[" as the escape character sequence.
112
What is badblocks?
It is a command that allows you to search a device for bad storage blocks.
113
How do you find the current default zone with the firewall-cmd command? (Pgs. 507-508)
firewall-cmd - -get-default-zone -- Displays the current default zone.
114
How do you set the default zone to a new zone with the firewall-cmd command? (Pgs. 507-508)
firewall-cmd - -set-default-zone= -- Sets the current default zone to a specified zone.
115
How do you display the services accessible through a zone with the firewall-cmd command? (Pgs. 507-508)
firewall-cmd \--list-all -- Displays all services and interfaces allowed through a zone.
116
How do you add and allow a service through a firewall with the firewall-cmd command? (Pgs. 507-508)
Example: firewall-cmd \--add-service=http \--zone=home -- Allows the HTTP service to pass through the "home" zone.
117
What firewall-cmd flag would you need to make a change to a firewall which keeps on reboot? (Pgs. 507-508)
firewall-cmd --permanent -- Applies a firewall change to be persistent, including on reboot.
118
What firewall-cmd flag would you need to make firewall settings immediately take effect? (Pgs. 507-508)
firewall-cmd - -reload -- Reloads the firewall config to put it into effect.
119
What are the main chains of iptables?
FORWARD, INPUT, OUTPUT
120
What are the four filter table policies of iptables?
ACCEPT, DROP, QUEUE, REJECT
121
How do you list all rules with the iptables command?
iptables -L -- Lists all rules in iptables chain.
122
How do you delete a rule with the iptables command?
Example: iptables -D FORWARD 1 -- Deletes the first rule in the FORWARD chain.
123
How do you set a default policy with the iptables command?
Example: iptables -P INPUT DROP -- Specifies that the default policy for the INPUT chain is to DROP connections.
124
What is an example to disallow a protocol's traffic with the iptables command?
Example: iptables -A INPUT -s 0/0 -p icmp -j DROP -- Sets that ICMP traffic should be dropped from all IP addresses (0/0).
125
What is an example for allowing an IP address's traffic with the iptables command?
Example: iptables -A INPUT -i eth0 -s 192.168.2.0/24 -j ACCEPT -- Set that traffic from the 192.168.2.0 network on interface eth0 should be accepted.
126
How do you list all services with the chkconfig command? (Pg. 503)
chkconfig -l -- Lists all services. ("-l" = Lowercase L)
127
How do you turn on a service with the chkconfig command? (Pg. 503)
Example: chkconfig auditd on -- Turns on the auditd daemon.
128
How do you turn on a service at specific levels with the chkconfig command? (Pg. 50)
Example: chkconfig \--level 35 auditd on -- Turns on the auditd daemon at levels 3 and 5.
129
What does Anaconda do? (Pg. 602)
Anaconda is a Linux system installer for Red Hat systems.
130
How many fields of /etc/passwd are there? (Pgs. 101-102)
There are 7 properties.
131
What are the fields of /etc/passwd? (Pgs. 101-102)
user_name, password, UID, GID, comment/GECOS, home_directory, default_shell
132
How many of fields of crontab are there? (Pgs. 275-276)
There are 6 fields.
133
What are the fields of crontab? (Pgs. 275-276)
Minute, Hour, Day of Month, Month, Day of Week, Command
134
What is the main config file for crontab? (Pgs. 275-276)
/etc/crontab
135
What are the crontab file directories? (Pgs. 275-276)
/etc/cron.hourly, /etc/cron.daily, /etc/cron.weekly, /etc/cron.monthly
136
How often does the Linux system check for cron jobs? (Percipio Video)
Every Minute
137
What is the most common directory where user crontabs are stored? (Pg. 275 and Percipio Video)
/var/spool/cron/crontabs/\ -- In other distributions, the “crontabs” part of the path could be just “tabs” or not be present at all.
138
With what command can you edit a new crontab? (Pg. 276)
crontab -e -- This edits a user’s crontab file in an editor interface.
139
With what command can you display the crontab jobs? (Pg. 276)
crontab -l -- This lists out the jobs in a crontab file. ("-l" = Lowercase L)
140
With what command can you remove a user’s crontab file? (Pg. 276)
crontab -r -- This removes/deletes the user’s crontab file.
141
What does the "nm" of "nmtui" and "nmcli" mean? (Pgs. 452-453)
"nm" = "NetworkManager"
142
What are nmtui and nmcli? (Pgs. 452-453)
They are used to manage network connections. The NMTUI tool is a Text User Interface, providing a graphical tool to change network settings. And the NMCLI tool is a Command Line Interface, providing a terminal interface for users to change network settings.
143
What are runlevels 0, 1, 3, 5, and 6? (Pgs. 342 and 348)
Rununit Runlevels: 0 -- Halt 1 -- Text-based Single-user Mode/Rescue Mode 3 -- Text-based Multi-user Mode 5 -- Graphical-based Multi-user Mode 6 -- Reboot
144
How do you set a runlevel with systemctl? (Pgs. 342 and 348)
Example: systemctl isolate runlevel5.target -- Sets the current runlevel to Runlevel 5.
145
How do you set a default runlevel with systemctl? (Pgs. 342 and 348)
Example: systemctl set-default runlevel5.target -- Sets the default runlevel to Runlevel 5.
146
What will be shown in /etc/shadow if a user account is locked? (Pg. 119 and Online)
There will be an exclamation point (!) preceding the password field in /etc/shadow.
147
What will be shown in /etc/shadow the password for a user account has not been set? (Pg. 108 and Online)
There will be two exclamation points (!!) preceding the password field in /etc/shadow. (This may differ in different distros; it could be set as only one exclamation point.)
148
What will be shown in /etc/shadow if a user account is disabled? (Pg. 109)
There will be an asterisk ("\*") in the password field in /etc/shadow.
149
What is the numerical permission value for the SUID? (Pg. 171-172)
4 -- SUID (4000)
150
What is the numerical permission value for the SGID? (Pg. 171-172)
2 -- SGID (2000)
151
What is the numerical permission value for the Sticky Bit? (Pg. 171-172)
1 -- Sticky Bit (1000)
152
What is the port for FTP?
20 & 21 -- FTP
153
What is the port for SSH?
22 -- SSH
154
What is the port for Telnet?
23 -- Telnet
155
What is the port for SMTP?
25 -- SMTP
156
What is the port for DNS?
53 -- DNS
157
What is the port for HTTP?
80 -- HTTP
158
What is the port for POP3?
110 -- POP3
159
What is the port for NTP?
123 -- NTP
160
What is the port for LDAP?
389 -- LDAP
161
What is the port for HTTPS?
443 -- HTTPS
162
What is the port for SNMP?
161 & 162 -- SNMP
163
What is the port for MySQL?
3306 -- MySQL
164
What does PXE generally do?
PXE is a utility which can remotely boot a Linux system, using that system's NIC connection.
165
What is Terraform, simply? (Pg. 577)
It is an IaC solution which provisions data centers using JSON. Think of Ansible, Chef, Puppet, etc.
166
What is shown with the w command? (Pgs. 540-541)
It lists all logged-in users and the processes they are running.
167
How many fields of ls -l are there? (Pg. 125)
There are 7 fields listed for each line of ls -l.
168
What are the fields of ls -l? (Pg. 125)
permissions, number of links, owner, group owner, file size (in bytes), modification date/time, filename
169
How is the awk command used, generally? (Pgs. 426-427)
It is used to print formatted text from a file, generally line-by-line with respect to columns.
170
What is the alternate command for awk? (Pgs. 426-427)
gawk
171
What is an example of printing column fields with the awk command? (Pgs. 426-427)
Example: ls -l | gawk '{ print $1,$9 }' -- This prints columns 1 and 9 from the output of ls -l.
172
What is an example of adding a divider when printing column fields with the awk command? (Pgs. 426-427)
Example: ls -l | gawk '{ print $1,"\t" $9 }' -- This takes columns 1 and 9 of the ls -l output and adds a tab between them.
173
What does "sed" mean? (Pgs. 422-423)
"sed" = "Stream EDitor"
174
What is the sed command generally used for? (Pgs. 422-423)
It edits the output stream of text in a specified manner.
175
How do you print without the pattern space with the sed command? (Pgs. 422-423)
sed -n -- This is an extremely important argument, which removes some of the extra lines from the output text.
176
What is an example of printing specific lines with the sed command? (Pgs. 422-423)
sed -n 3,+3p /etc/passwd -- This prints the line #3 and then three additional (+) lines after that in the file.
177
What is an example of searching and replacing pattern with the sed command? (Pgs. 422-423)
sed -n 's/root/fred/p' /etc/passwd -- This substitutes instances of "root" for "fred" in the /etc/passwd file.
178
What does the "tr" command mean? (Pg. 418)
"tr" = "TRanslate"
179
How do you delete all instances of a character in a file with the tr command? (Pg. 418)
tr -d \ -- This deletes all instances of the character set.
180
How do you replace characters in a file with the tr command? (Pg. 418)
tr -s -- This squeezes/replaces the old characters with the new characters.
181
How do you convert all lowercase characters to uppercase ones, for instance, with the tr command? (Pg. 418)
Example: grep root /etc/passwd | tr [a-z] [A-Z] -- This translates all of the characters in the file from lowercase to uppercase.
182
What is the primary element that the "cut" command handles from a file? (Pg. 419)
The "cut" tool is primarily designed to handle and extract columns from a file.
183
How do you specify numbered characters with the cut command? (Pg. 419)
Example: cut -c 1,3,5 -- This cuts out the first, third, and fifth characters from a file.
184
How do you specify delimiters with the cut command? (Pg. 419)
Example: cut -d " " -- This specifies the space character as a file's delimiter.
185
How do you specify numbered fields with the cut command? (Pg. 419)
Example: cut -d " " -f1,3 -- This extracts the first and third fields (columns) from a file.
186
What the "nl" command mean? (Pgs. 419-420)
"nl" = "Number Lines"
187
What does the nl command generally do? (Pgs. 419-420)
It adds line numbers to a file.
188
How do you add line numbers to all lines in a file (including blanks) with the nl command? (Pgs. 419-420)
nl -a -- This adds line numbers to all lines of a file, including blank lines.
189
What does the "od" command mean? (Pgs. 421-422)
"od" = "Octal Dump"
190
What does the od command generally do? (Pgs. 421-422)
It converts a file to a specific character set.
191
How do you convert a file to octal characters with the od command? (Pgs. 421-422)
od -b -- This converts the specified file to an octal dump.
192
What does the split command do? (Pg. 430)
It is used to split a file into smaller parts.
193
What the two main arguments of the split command? (Pg. 430)
-l and -b -- The "-l" divides a file by n-number of lines and "-b" by n-number of bytes.
194
What is the general format of the split command? (Pg. 430)
split <-l | -b> <#> -- This splits the input file by a specified number of lines or bytes and outputs the individual pieces into multiple files, each with output prefix in the front of it.
195
What is the uniq command used to do? (Pgs. 430-431)
It is used primarily to remove consecutive, duplicate lines from a file.
196
How do you print duplicate lines with the uniq command? (Pgs. 430-431)
Example: uniq -d lastnames -- This prints only the consecutive lines in the file "lastnames" that are duplicate.
197
How do you print without duplicates with the uniq command? (Pgs. 430-431)
Example: uniq -u lastnames -- This prints only the unique lines in the file "lastnames," omitting duplicates.
198
What do the commands netstat, nc, traceroute, and ping do, generally speaking? (Pgs. 462-467)
netstat gives network information, specifically network connections, the routing table, and interface info. ping tests whether a connection can be made with a server. nc has many uses but specifically performs tests relating to port connections. traceroute displays the routing path of travel it takes to send packets to an external server.
199
What are the two main keywords in a resolv.conf file? (Pg. 459)
Keywords: - search -- This specifies the domain which should be used to fill out incomplete hostnames. - nameserver -- This defines the IP address of a DNS server.
200
What is the resolv.conf file's general format? (Pg. 459)
Example: search mydom.com -- This searches the address "mydom.com" address for completing incomplete hostnames. nameserver 8.8.8.8 -- This specifies the IP address 8.8.8.8 as a nameserver for the server.
201
What are the modes of SELinux? (Pg. 559)
Enforcing, Permissive, Disabled
202
What do the modes of SELinux each denote? (Pg. 559)
Modes of SELinux: - Enforcing -- This denies access to users from applications/processes based on SELinux policies. - Permissive -- This allows users to access applications/processes, but it sends logs when a user encroaches on SELinux policies. - Disabled -- This wholly disables SELinux on a Linux system.
203
What is the default policy of SELinux and what does it denote? (Pg. 559)
"Targeted" is the default policy for SELinux. It defines application/process accessibility on an admin-defined, granular level.
204
What are the modes of AppArmor? (Pgs. 562-563)
Enforce, Complain
205
What do the modes of AppArmor each denote? (Pgs. 562-563)
Modes of AppArmor: - Enforce -- It permits the minimum amount of permissions for users and applications to interact between each other based on the AppArmor rules. - Complain -- It permits users and applications to run as normal but logs any violation of AppArmor rules.
206
How do you enable AppArmor enforce mode, for example? (Pgs. 562-563)
Example: aa-enforce /etc/apparmor.d/* -- With profiles being defined under the apparmor.d directory, the profiles are only permitted minimum permissions to files and applications.
207
What is the sister command to docker? (Pgs. 597-601)
podman
208
How do you display a list of the Docker containers on a system? (Pgs. 597-601)
docker images -- Lists all of the Docker containers on a system.
209
How do you run a Docker container in the background? (Pgs. 597-601)
docker run -d -- This runs a Docker container in the background.
210
How do you run a Docker container with an interactive terminal? (Pgs. 597-601)
docker run -it -- This runs a Docker container with an interactive terminal. Enter "exit" to exit.
211
How do you manually start up a Docker container? (Pgs. 597-601)
docker start -ai \ -- This attaches a Docker container interactively in order to restart the specified, existing container.
212
How do you end the run of a Docker container? (Pgs. 597-601)
docker stop -- This manually stops the run of a Docker container.
213
How do you delete a Docker container? (Pgs. 597-601)
docker rm \ AND THEN docker rmi \ -- The first command removes the container and then the second command removes the container image.
214
How do you add a pod to a running Docker container? (Pg. 597 and Online)
docker attach -- This attaches the specified pod to a running container.
215
How do you create a container image based on a modified Docker container? (Pg. 597 and Online)
docker commit \ \ -- This creates a Docker image based upon a specified container. This is especially useful for testing versions of a container.
216
How do you list logging details from a Docker container image? (Pg. 597)
docker logs -- This prints out the logs of a Docker container.
217
How do you display port mappings of a Docker container? (Pg. 597)
docker port -- This displays port mappings of a Docker container.
218
How do you stop and immediately restart a Docker container with one command? (Pg. 597)
docker restart -- This stops and then restarts a specified Docker container.
219
How do you save a Docker image to an archive file? (Pg. 597 and Online)
Example: docker save busybox > busybox.tar -- This saves the specified Docker image “busybox” as a tarball archive.
220
How do you display the running processes within a Docker container image? (Pg. 597)
docker top -- This displays the running processes within a Docker container image like the Linux “top” command.
221
How do you display all running and exited Docker containers? (Pg. 600)
docker ps -a -- This displays all (“-a”) running and exited Docker containers.
222
How do you bring a Docker container which is running in the background to the foreground? (Pg. 597, Online Lab, and Online)
Example: docker attach busybox -- This brings the specified Docker container “busybox” into the foreground.
223
What is the difference between “docker run” and “docker start?” (Online)
The “docker run” command will download and create a container if it is not present and then run the container. The “docker start” command will run an existing container on a host.
224
What is network bonding used to do? (Pgs. 592-593 and Found Online)
Network bonding takes the connections from multiple NICs and teams them to provide for a potentially faster network connection by using multiple interfaces instead of just one.
225
What is network bridging used to do? (Pgs. 592-593 and Found Online)
Network bridging provides a connection between multiple networks. This allows devices on different networks to be able to interact with each other.
226
How many main stages of booting a Linux system are there? (Pg. 332)
There are 4 main stages for Linux boot.
227
What are the main stages of a Linux system boot and what is their order? (Pg. 332 and Practice Exam #A14)
BIOS -> [POST -> MBR ->] GRUB -> Kernel/Primary Partition -> Systemd/Stage 2 Bootloader
228
What is done for each stage of the Linux boot process? (Pg. 332 and Practice Exam #A14)
Stages of Linux Boot: - BIOS -- Initializes hardware. - [POST -- Checks system integrity, including BIOS, and loads MBR.] - [MBR -- Loads the first sector of the primary partition from the partition table.] - GRUB -- Loads the kernel. - Kernel/Primary Partition -- Mounts the root filesystem and loads default.target. - Systemd/Stage 2 Bootloader -- Initializes the system.
229
How do you generate an SSH key of type DSA or RSA? (Pg. 491)
ssh-keygen -t -- This generates an SSH key pair in DSA or RSA form.
230
How do you transmit an SSH key to a specified client? (Pg. 494 and Online)
ssh-copy-id \@\ -- This copies an SSH public key over to a specified client address and into the ~/.ssh/authorized_keys file.
231
How do you prevent external users from being able to log in via root through SSH? (Online Lab)
Go to the SSH config file /etc/ssh/sshd_config. Then uncomment and set the “PermitRootLogin” line to “no.”
232
How do you disable the ability to connect via SSH to a host with just a password (without keys)? (Online Lab)
Go to the SSH config file /etc/ssh/sshd_config. Then uncomment and set the “PasswordAuthentication” line to “no,” forcing users to connect via an SSH key.
233
What is fail2ban? (Practice Exam #A21)
fail2ban is an intrusion protection system which dynamically bans IP addresses after they have exceeded a certain number of unsuccessful login attempts.
234
What is netfilter? (Pg. 509 and Practice Exam #A21)
Netfilter is a security infrastructure tied to the Linux kernel which handles packet filtering as well as address and port translation.
235
What is Kubernetes? (Pg. 601 and Practice Exam #A30)
Kubernetes is a platform designed for orchestrating, automating, and scaling the deployment of containers.
236
What command is used to create an initramfs image? (Pg. 341, Practice Exam #A33, and Online)
dracut -- This command is used to generate initramfs, which is a CPIO archive image used by the kernel to boot the system.
237
What are the two things that GRUB2 starts upon load? (Pg. 340)
GRUB2 loads the system kernel, vmlinux, and starts the initial RAM disk, initrd, or filesystem, initramfs.
238
What is the first filesystem loaded into the system’s memory upon boot? (Pgs. 340-341 and Practice Exam #A33, #A88)
initrd OR initramfs
239
What is the primary purpose of initramfs? (Practice Exam #A88 and Online)
The primary purpose is to assemble and mount the root filesystem (/) upon boot.
240
What is PVC? (Practice Exam #A33)
“PVC” = “Persistent Volume Claims”
241
What does PVC do? (Practice Exam #A33)
PVCs are “claim checks” for a given resource to hold and access physical disk space for containers using Kubernetes.
242
Instead of a cron job, what can you use to run a deferred job that won’t execute while a previous instance is still executing? (Pgs. 280-281, Practice Exam #A35, and Online)
systemd timer file
243
What is an example of a systemd timer file path? (Pgs. 280-281, Practice Exam #A35, and Online)
/etc/systemd/system/\.timer -- Timers ought to be put into the /etc/systemd/system directory in order to be handled by systemd. A “systemctl start \” can be used to activate the file.
244
What does the “OnBootSec” field describe in a systemd timer file? (Pgs. 280-281, Practice Exam #A35, and Online)
The “OnBootSec” field specifies the number of seconds after boot that a job should execute.
245
What does the “OnCalendar” field describe in a systemd timer file? (Pgs. 280-281, Practice Exam #A35, and Online)
The “OnCalendar” field specifies the minute a job should execute. Examples: Sun..Sat *-*-* 20:00:00 OR minutely OR monthly
246
What does “telinit” mean? (Pg. 342)
“telinit” = “Tell Init” -- It tells the init process to perform some action.
247
What does telinit generally do? (Pg. 342)
The telinit command is used mostly to change runlevels. It communicates with the main init process to perform system tasks. Example: telinit 6 -- Instructs the system to reboot.
248
How is ipset used and what command is it typically used with? (Practice Exam #A41 and Online)
The ipset command is used to create a structure set of IP addresses which can be applied to a defined iptables ruleset. The ipset is most useful in conjunction with the iptables command.
249
What is ipadm used to do? (Practice Exam #A41 and Online)
ipadm is used to configure a network much like the ip command.
250
What is an example of removing an interface from the network configuration with the ipadm command? (Online)
ipadm disable-if -t -- This disables a specified network interface from the configuration. (“enable-if” would likewise enable reenable the interface.)
251
How do you add an IP address to a specified ipset address set? (Practice Exam #C16 and Online)
Example: ipset -A IPBlocks 10.2.1.50 -- This adds the address 10.2.1.50 to the predefined set of addresses called “IPBlocks,” which will be blocked on the specified network.
252
How do you add a privileged port number with the ipadm command? (Practice Exam #C46)
Example: ipadm set-prop -p extra_priv_ports+=2700 tcp -- This adds Port 2700 as a privileged TCP port which can only be used by root users.
253
What does the dmesg command show? (Pg. 356 and Practice Exam #A42)
The dmesg command shows log messages for the Linux kernel, including boot messages.
254
What is the difference between insmod or rmmod and modprobe? (Pgs. 362-363)
The modprobe command accounts for dependencies, while insmod and rmmod do not.
255
How do you add a kernel module using the modprobe command? (Pgs. 362-363)
modprobe install -- This installs the specified module, including its dependencies.
256
How do you add an alias to a module with the modprobe command? (Pgs. 362-363)
modprobe alias \ \ -- This sets a specified alias for the specified module.
257
How do you remove a module with the modprobe command? (Pgs. 362-363)
modprobe -r -- This removes a specified module, including its dependencies.
258
What do TLS and DTLS mean? (Practice Exam #A44)
“TLS” = “Transport Layer Security” and “DTLS” = “Datagram Transport Layer Security”
259
What is the main difference between TLS and DTLS? (Practice Exam #A44)
TLS is based upon TCP, being loss-intolerant, and DTLS is based on UDP, which is loss-tolerant.
260
What two commands does pgrep combine? (Pg. 261 and Practice Exam #A45)
ps and grep -- It greps the process information of the ps command.
261
How do you list process names and IDs with the pgrep command? (Pg. 261 and Practice Exam #A45)
pgrep -l -- This lists a process name and process ID. ("-l" = Lowercase L)
262
How do you search for a user’s processes using the pgrep command? (Pg. 261 and Practice Exam #A45)
pgrep -u -- This does a search for processes with the specified username.
263
What is a stateful firewall? (Pgs. 505-506, Practice Exam #A49, and Online)
A stateful firewall looks at network traffic end-to-end, including traffic patterns. It can implement encryption and tunneling.
264
What is a stateless firewall? (Pgs. 505-506, Practice Exam #A49, and Online)
A stateless firewall is a passive monitor which filters packets, looking at source and destination addresses.
265
What value is returned if a bash file executes successfully? (Practice Exam #A50)
0 (A non-zero value indicates an error occurred.)
266
What are the three bash file descriptors and what do they mean? (Practice Exam #A50)
File Descriptors: 0 -- STDIN 1 -- STDOUT 2 -- STDERR
267
Where are default systemd unit files found? (Pg. 344)
/usr/lib/systemd/system – This is where default systemd unit files are held. Custom unit files can be put in /etc/systemd/system to override default files.
268
What does the “What” option mean in a mount unit file? (Pg. 346 and Practice Exam #A53)
The “What” denotes the absolute path of the device to mount.
269
What does the “Where” option mean in a mount unit file? (Pg. 346 and Practice Exam #A53)
The “Where” denotes the filesystem path of where the device will be mounted.
270
What does the “Type” option mean in a mount unit file? (Pg. 346 and Practice Exam #A53)
The “Type” denotes the filesystem type being mounted.
271
How can you get the ACL permission info for a file? (Pgs. 175-176)
getfacl -- This displays the ACL permissions for a specified file.
272
What does ACL stand for? (Pgs. 175-176)
“ACL” = “Access Control List”
273
What is an example of setting ACL permissions for a file? (Pgs. 175-176)
setfacl -m u:nathand:r contracts.odt -- This modifies the ACL permissions of the file “contracts.odt,” adding read permissions for the user “nathand.”
274
How can you shut down all connections and drop all packets with the firewall-cmd command? (Practice Exam #A60)
firewall-cmd -panic-on -- This causes the system to drop all drop all connections and packets in the case of a firewall emergency.
275
What does the “DMI” mean in dmidecode? (Pg. 609 and Practice Exam #A61)
“DMI” = “Desktop Management Interface”
276
What command can you use to see the manufacturer of the Linux and BIOS information? (Pg. 609 and Practice Exam #A61)
dmidecode -- This displays the BIOS and key hardware information for a Linux system.
277
What is another name for the cron.hourly, cron.daily, cron.weekly, and cron.monthly directories?
/etc/cron.interval -- This is not a real directory but distinguishes the directories where jobs can be placed to automatically run on an hourly, daily, weekly, or monthly basis.
278
How do you edit the quota for a user? (Pgs. 212-213)
edquota -u -- This edits the quota for the specified user.
279
How do you edit the quota for a group? (Pgs. 212-213)
edquota -g \ -- This edits the quota for the specified group.
280
How do you list out the quota for a filesystem? (Pgs. 212-213)
repquota -- This reports the quota amount for the specified filesystem.
281
How do you list all the quotas on a system? (Pgs. 212-213)
repquota -a -- This reports all the filesystem quota on the system.
282
How do you create user and group quota database files at a specified filepath? (Pgs. 212-213)
quotacheck -cug \ -- This creates user and group quota database files at the specified path.
283
With what command, can you kill all of a user’s processes and log them out? (Pg. 541 and Practice Exam #A64)
pkill -KILL -u \ -- This will end all of the processes of a specified user and log them out.
284
What config file can you add to prevent non-root users from being able to login? (Pg. 541 and Practice Exam #A64)
/etc/nologin -- The presence of this file prevents all users, except root, from being able to login to the system.
285
What is rsync and what does it do? (Pg. 230 and Practice Exam #A67)
The rsync command synchronizes and clones copies of files between two servers.
286
What does the command “rsync cblackwell@192.168.2.42:/home/cblackwell -arv ubuntu_server_files” do? (Percipio Course)
This copies the files under the home directory of the user "cblackwell" on the remote server "192.168.2.42" to the local directory under a folder called "ubuntu_server_files." ("-a" = Archive the files. "-r" = Recursive. "-v" = Verbose output.)
287
What does the patch command do? (Practice Exam #A67 and Online)
The patch command is used to apply patches to source code files.
288
What is an example of patching source code with the patch command? (Practice Exam #A67 and Online)
patch -p1 -i /usr/akaul/2019-patch -- This applies the patch file /usr/akaul/2019-patch.
289
What does the dd command generally do? (Pg. 234 and Practice Exam #A67)
The dd command duplicates disk devices or converts their format.
290
What is an example of duplicating a disk device? (Pg. 234 and Practice Exam #A67)
dd if=/dev/sda of=/dev/sdb -- This duplicates the device /dev/sda to the new device /dev/sdb.
291
What is auditd? (Practice Exam #A69)
auditd is a system monitoring daemon at the kernel level. It is the default logging tool for SELinux.
292
How can you see logging details for a Docker image configuration, including IP addresses? (Pg. 597 and Practice Exam #A73)
docker inspect -- This lists configuration details for a specified Docker container image.
293
What is an example of printing a file? (Practice Exam #A76)
Example: lpr printme.txt -- This prints the file “printme.txt” using the lpd printing daemon.
294
What mode do you need to get in to do a fsck on /usr? (Practice Exam #A77)
Single-User Mode (Mode 1). On /usr and similar directories, you would need to get into single-user mode in order to fix problems with the disk that users are on with fsck.
295
What is /etc/hosts? (Pg. 458 and Practice Exam #A80)
The /etc/hosts is a manual resolver file which matches IP addresses to domain names and aliases. It is a manual list of address; it is not produced by DNS. It is the first, default name resolver on a Linux system.
296
What is /etc/sysconfig/network used to do and what are four things it is used to define? (Pg. 460 and Practice Exam #A84)
It is a file which can be used to configure a system’s network. It includes whether to allow NETWORKING=, to FORWARD_IPV4, define a HOSTNAME=, and define a remote GATEWAY=, among other things.
297
What is /etc/host.conf used to do? (Practice Exam #A84)
It is used to specify the order of which method to use to resolve a domain name. (Example: order hosts, bind -- Check /etc/hosts then DNS.)
298
With what command can you enable an SELinux mode? (Pg. 559)
setenforce -- This sets the SELinux mode on a system.
299
With what command can you display the current SELinux mode? (Pg. 559)
getenforce -- This displays the current SELinux mode on a system.
300
How can you set an SELinux mode with numbers and what do they mean? (Practice Exam #A86)
Setting SELinux with Numbers: - setenforce 1 -- This puts SELinux in Enforcing mode. - setenforce 0 -- This puts SELinux in Permissive mode.
301
What is the main configuration file for SELinux? (Pgs. 559-560 and Online)
/etc/selinux/config
302
How can you view all of the currently mounted filesystems on a system? (Practice Exam #A89)
mount -- This lists all of the mounted filesystems on a Linux system.
303
How do you create a bridge with the brctl command? (Pg. 498 and Practice Exam #A90)
Example: brctl addbr trilby -- This adds a bridge with the name “trilby” to the network.
304
How do you add network interfaces to a bridge with brctl command? (Pg. 498)
Example: brctl addif trilby enp0s9 enp0s10 -- This adds two network interfaces (“enp0s9” and “enp0s10”) to the bridge “trilby.”
305
What does arp stand for? (Pg. 444 and Practice Exam #B5)
“ARP” = “Address Resolution Protocol”
306
How is the arp utility used? (Pg. 444 and Practice Exam #B5)
The arp utility is used to map IPv4 addresses to MAC addresses. This makes LANs run faster.
307
What command would be best to combine the contents of files into two columns? (Practice Exam #B6)
Using the paste command. (e.g., paste file1.txt file2.txt)
308
What is an example of combining two files with a delimiter, using the paste command? (Online)
paste -d “|” -- This combines two specified files side-by-side with a “|” delimiter.
309
How is ioping used? (Pg. 211 and Practice Exam #B7)
The ioping command checks the Input/Output (I/O) latency for a disk.
310
What does iostat show? (Pgs. 211, 615 and Practice Exam #B7)
The iostat displays information regarding I/O read and write activity per second as well as total I/O and CPU loads.
311
How do you display the I/O history since the last system boot? (Practice Exam #B7)
iostat -d 2 – This shows the I/O statistics history since the last system boot with a delay (“-d”) of two-second intervals.
312
What command monitors network traffic and high latency issues on networks? (Pg. 622 and Practice Exam #B8)
iftop -- This brings up an interface, detailing the network traffic on a system every two seconds (like top).
313
How would you monitor the traffic of a specific network interface with the iftop command? (Practice Exam #B8)
Example: iftop -i eth1 -- This displays the traffic for the interface “eth1.”
314
What does “udev” mean? (Pg. 368)
“udev” = “userspace /dev/”
315
What command would you use to query about hardware devices under /dev? (Pgs. 370-371 and Practice Exam #B9)
udevadm -- This works to query info, monitor, and manage devices on a system.
316
What is an example of querying properties of a device with the udevadm command? (Pgs. 370-371)
Example: udevadm info -q property -n /dev/sdb -- This queries (-q) for the property info of the specified device (-n) /dev/sdb.
317
What can be used to display memory access, interrupt, and I/O Port information for installed hardware? (Pg. 374, Practice Exam #B9, and Online)
lsdev
318
What shortcut would print the name of a bash script? (Pg. 407 and Practice Exam #B12)
$0 -- This displays the name of the file (as it is the 0th argument on the command line).
319
What shortcut would print the name of an nth argument to a script? (Pg. 407 and Practice Exam #B12)
$[n] -- This displays the nth number argument to a script.
320
What shortcut lists the number of arguments to a script? (Pg. 407 and Practice Exam #B12)
$#
321
What shortcut lists the command-line arguments to a script? (Pg. 407)
$*
322
What shortcut displays the current process’s PID? (Pg. 407)
$$
323
What shortcut displays the PID of the last background job? (Pg. 407)
$!
324
What shortcut displays the command exit status code? (Pg. 407)
$?
325
What command can you use to display all of the available partition types on a system? (Practice Exam #B17)
/sbin/sfdisk -T -- This shows all partition types and their codes.
326
How do you modify a file without creating a new file with the sed command? (Practice Exam #B19 and Online)
Example: sed -i ‘s/File Transfer Protocol/FTP/’ netspecs.doc -- This edits the netspecs.doc file in-place (-i), substituting the instances of “File Transfer Protocol” with “FTP.”
327
What command would you use to set the time zone? (Pg. 80)
With ln or cp: - Example: ln -s /usr/share/zoneinfo/US/Central /etc/localtime -- This links a time zone file to being the time zone config file /etc/localtime. - Example: cp /usr/share/zoneinfo/US/Central /etc/localtime – This copies over a time zone file to being the time zone config file /etc/localtime.
328
How do you lock a user’s account with the usermod command? (Practice Exam #B24)
usermod -L -- This locks the specified user’s account.
329
How would you set the system time to the current time of the hardware clock? (Pg. 81 and Practice Exam #B27)
hwclock <-s/--hctosys> -- This sets the hardware clock to the current system time.
330
How would you set the hardware clock time to the current system time and time zone? (Pg. 81 and Practice Exam #B27)
hwclock <-w/--systohc> -- This sets the system time to the time of the hardware clock.
331
What daemon and command would you use to list defined networks in KVM? (and Practice Exam #B29)
libvrt -- This daemon manages a list of defined networks for a KVM system. virsh net-list – This command lists the defined networks under libvrt.
332
What command should be used to analyze the boot time for each system run unit? (Practice Exam #B34)
systemd-analyze blame
333
What does the system-analyze blame command do? (Practice Exam #B34)
The systemd-analyze blame command lists all of the running units on a system and the time each took to initialize.
334
What does dpkg stand for? (Pg. 306)
“dpkg” = “Debian PacKaGe Manager”
335
How do you install a package with the dpkg command? (Pg. 307 and Practice Exam #B41)
dpkg -i -- This installs a DPKG package.
336
How do you uninstall a package with the dpkg command without deleting config files? (Pg. 307 and Practice Exam #B41)
dpkg -r \ -- This removes a DPKG package, without deleting any config files.
337
How do you list all of the packages on a system with the dpkg command? (Pg. 307 and Practice Exam #B41)
dpkg -l -- This lists all DPKG packages on a system. ("-l" = Lowercase L)
338
How do you list all files that were installed by a specific package with the dpkg command? (Pg. 307 and Practice Exam #B41)
dpkg -L -- This lists all of the files that were installed by a specific package.
339
How do you list the package that installed a specific file with the dpkg command? (Pg. 307 and Practice Exam #B41)
dpkg -S -- This identifies which DPKG package installed the specific file.
340
How do you list the packages which have been partially installed with the dpkg command? (Practice Exam #B41)
dpkg -C -- This specifies all of the partially installed packages on a system.
341
What is a helper service for a container called? (Pg. 595)
ambassador container
342
What is a formation of multiple containers called? (Pg. 595)
pod
343
What is a helper container for a pod called? (Pg. 595)
sidecar
344
What is a formation of multiple pods called? (Pg. 596)
deployment
345
What is a group of multiple servers and/or desktops networked together called? (Pg. 596)
cluster
346
What is spooling data? (Online)
Spooling data is a buffer file which resides in a system’s storage until an external device can pick up the data in the file. Notably, a printer would use spooling files.
347
Under which directory is spooling data stored on a Linux system? (Practice Exam #B48)
/var -- As spool data should be temporary and could be deleted, depending on the job, it can be placed under this directory as logs and other transient data.
348
How do you display the current password age information with the chage command? (Pg. 109)
chage -l \ -- This lists password age expiration information for specified username. ("-l" = Lowercase L)
349
How do you set the password's last changed date with the chage command? (Pg. 109)
chage -d -- This sets the last changed date for the password of a specified username.
350
How do you set the minimum days for password age with the chage command? (Pg. 109)
chage -m <#> -- This sets the minimum days for password change of a specified username.
351
How do you set the maximum days for password age with the chage command? (Pg. 109)
chage -M <#> -- This sets the maximum days for password change of a specified username.
352
How do you set the warn days for password age with the chage command? (Pg. 109 and Practice Exam #B52)
chage -W <#> -- This sets the warn days for password expiration of a specified username. (A negative number will disable the password.)
353
How do you set the inactive days for password age with the chage command? (Pg. 109 and Practice Exam #B52)
chage -I \<#\> \ -- This sets the inactive days for password expiration of a specified username. (A negative number states that a password will never become inactive.) ("-I" = Uppercase I)
354
How do you set the expire date for password age with the chage command? (Pg. 109 and Practice Exam #B52)
chage -E -- This sets the expire date for password expiration of a specified username. (A negative number will disable password expiration.)
355
What is X11 Forwarding? (Practice Exam #B61 and Online)
X11 is a tunneling utility which allows a user to run a remote computer’s GUI from a local machine. It is much like Remote Desktop on Windows.
356
What is Local Forwarding? (Pgs. 496-497, Practice Exam #B61, and Online)
Local forwarding is a matter of port forwarding from a local client tunneled through a specified port on a remote server as a jump server to a destination machine.
357
What is an example of setting up local port forwarding with SSH? (Pgs. 496-497, Practice Exam #B61, and Online)
Example: ssh -L 3336:website.server.com:3306 jump.server.com -- This configures an SSH connection from Port 3336 on the local client via the specified jump server (jump.server.com) to Port 3306 on the destination website (website.server.com).
358
What is Remote Forwarding? (Practice Exam #B61 and Online)
Remote forwarding is a matter of port forwarding from a remote server tunneled through a specified port on a local client as a jump server to a destination machine.
359
What is an example of setting up remote port forwarding with SSH? (Practice Exam #B61 and Online)
Example: ssh -R 8080:localhost:80 public.kaplan.it -- This configures an SSH connection via Port 8080 from the remote server (public.kaplan.it) via the local client specified as a jump server to Port 80 on the destination machine (in this case, itself – localhost).
360
With what commands can you display environment variables on a system? (Practice Exam #B68, Online, and Online)
env OR printenv
361
How do you run a command with an empty environment (no environment variables set)? (Online)
Example: env - /bin/sh -- This runs the command “/bin/sh,” which loads an empty environment where no environment variables are set. (Alternatively, “-i” could be used instead of a hyphen.)
362
How do you delete an environment variable with the env command? (Online)
env -u [variable_name] -- This unsets the specified variable, removing it from the list of environment variables.
363
What command would you use to make log files available permanently? (Practice Exam #B70)
Example: systemd-tempfiles \--create \--prefix /var/log/journal -- With the directory /var/log/journal manually created, this command takes logs from systemd and elsewhere and saves a copy of the logs in this directory.
364
What file lists the terminals that root users are allowed to login? (Pg. 617 and Practice Exam #B71)
/etc/securetty
365
What command can you use to disable root users from logging in? (Practice Exam #B71)
echo > /etc/securetty -- This will erase all terminal entries listed from the /etc/securetty file.
366
How can you get a listing of all the details of network interfaces with the ifconfig command? (Pg. 449 and Practice Exam #B72)
ifconfig -- The command by itself will show all of the details of the active network interfaces on the system.
367
How do you activate or deactivate a specified network interface with the ifconfig command? (Percipio Course and Online)
Example: ifconfig eth0 -- This brings specified NIC “eth0” to be up or down.
368
How can you display the MAC address of a specified NIC with the ip command? (Pg. 451 and Practice Exam #B72)
Example: ip link show eth0 -- This displays the MAC address (link) and other details for the specified interface eth0.
369
How do you add a user with a password that won’t expire with the useradd command? (Practice Exam #B73)
useradd -p -- This creates a user with a specifies password. Using the useradd command, the password will not expire.
370
How do you display a specified SELinux Boolean value? (Pg. 561 and Practice Exam #B75)
Example: getsebool cron_can_relabel -- This displays the SELinux Boolean value (on/off) for cron_can_relabel.
371
How do you enable or disable a specified SELinux Boolean value? (Pg. 561 and Practice Exam #B75)
Example: setsebool cron_can_relabel -- This sets the SELinux Boolean value for cron_can_relabel to on.
372
How do you make a SELinux Boolean value setting be retained across boots? (Practice Exam #B75)
setsebool -P \ \ -- This sets the specified SELinux Boolean value to on or off and makes this setting persistent (-P).
373
What SELinux Boolean value allows cron jobs to provide SELinux context labels? (Pg. 561)
cron_can_relabel
374
What SELinux Boolean value allows the FTP daemon full access? (Pg. 561)
ftpd_full_access
375
What SELinux Boolean value allows sysadm_u users the right to execute scripts? (Pg. 561)
sysadm_exec_content
376
What command lists detailed information for all hardware devices on the system? (Pg. 379 and Practice Exam #B81)
“lshw” = “LiSt HardWare”
377
How do you abbreviate output with the lshw command with the inclusion of hardware device paths? (Pg. 380)
lshw -short -- This lists a shorter output of results for lshw and includes device trees showing hardware paths.
378
How do you display hardware of a specific type with the lshw command? (Pg. 380)
Example: lshw -short -class disk -- This detailed information for all storage devices on the system.
379
What does the id command show? (Pg. 104 and Practice Exam #B90)
user ID, user ID number, group ID number, secondary groups
380
What command shows the most recently logged in users? (Pg. 555 and Practice Exam #B90)
last – This shows the recently logged-in users, login time, logout time, and where users authenticated.
381
What is agent-based monitoring? (Practice Exam #C4)
Agent-based monitoring involves the use of embedded security monitoring systems on a device. They are usually proprietary and cost more, but they tend to provide greater security than agentless systems.
382
What is agentless monitoring? (Practice Exam #C4)
Agentless monitoring involves data through industry standards, not an embedded software system. Though they are not as robust in security, they tend to be highly performant and cost less than agent-based systems.
383
How do you add a specific permission to a file for all users? (Practice Exam #C6)
Example: chmod a+x MyScript -- This adds execute permissions for all users to the file “MyScript.”
384
How do you create a Docker container image from ContainerFile instructions? (Pg. 597, Practice Exam #C7, and Online)
Example: docker build -t mydocker/dockerfiles -- This builds a container image named “dockerfiles” under the user “mydocker.” The -t flag (meaning tag) specifies the username and container name.
385
How do you add a Docker image to a Docker hub repository? (Pg. 597 and Practice Exam #C7)
docker push \ -- This pushes a specified Docker container image to a Docker hub repository.
386
How do you retrieve a Docker image from a Docker hub repository? (Pg. 597 and Practice Exam #C7)
docker pull -- This pulls a specified Docker container image from a Docker hub repository.
387
How do you stop a service, regardless of whether it is a dependency to other services? (Pg. 347 and Practice Exam #C15)
Example: systemctl mask https.service -- This manually forces a specified service (in this case, https.service) to stop, even if it is a dependency to other services. This is done by setting its unit file to a symbolic link of /dev/null.
388
How do you display the active systemd service units? (Percipio Course)
systemctl list-units \--type=service \--state=active -- This displays the active systemd service units on the system.
389
How do you display failed systemd units? (Percipio Course)
systemctl list-units \--failed -- This displays the systemd units which have failed. (You could also use the option “\--state=failed.”)
390
What is nmap used for? (Pgs. 502-503 and Practice Exam #C22)
The nmap command can be used to map the hosts that are running, services available on each host, and scan open ports on a network.
391
How would you determine the operating system of a host using the nmap command? (Practice Exam #C22)
Example: nmap 183.17.0.0/25 -O -- This scans the specified host 183.17.0.0/25 for its operating system (-O).
392
How do you change the owner and group of a specified file? (Pg. 161)
chown : -- This changes owning user and group for the specified file.
393
How do you change the owner of a directory, including all of its files? (Pg. 161 and Practice Exam #C23)
chown -R -- This sets the owner of the directory and its contents recursively (-R).
394
What is fstrim used to do? (Practice Exam #C24 and #C82 and Online)
The fstrim command is designed specifically for managing storage on SSD devices. It discards unused blocks on a mounted filesystem which can greatly improve device performance.
395
How do you completely reload a file from its last save with vim, negligent of any changes made to it? (Pg. 59 and Practice Exam #C28)
:e! -- This fully reloads a file from its last save point, deleting any changes made to the file in the vim editor.
396
How do you list out details for cached tickets of a Kerberos session? (Pg. 501 and Practice Exam #C30)
klist -v -- This prints out the ticket details of the current Kerberos session, including ticket length, expiration times, and renewal times.
397
How do you print out the addresses for Kerberos tickets? (Pg. 501 and Practice Exam #C30)
klist -a -- This prints out the addresses for tickets of the current Kerberos session.
398
What are the general steps to reset a root password if it is forgotten? (Practice Exam #C38)
Steps: - Reboot the system. - Go to GRUB > Advanced GRUB options. - Set init=/bin/bash. [Boot the system in Rescue Mode.] - Mount the root filesystem in read-write mode. (mount -n -o remount,rw /) - Change the root user’s password. (passwd root)
399
What are three of the major semanage subcommands? (Practice Exam #C45 and Online)
Subcommands: - semanage boolean -- This enables/disables specified SELinux rule sets. - semanage fcontext -- This manages SELinux context definitions for files. - semanage port -- This allows you to customize port definitions for SELinux.
400
How do you specify user and context permission with the semanage command? (Pg. 559 and Online)
-s for user AND -a for context permission -- These are important arguments for utilizing the semanage command. Example: semanage login -a -s user_u gosia -- This adds the login mapping for the user (-s) “gosia” with the SELinux “user_u” context (-a).
401
What is audit2allow? (Pg. 562 and Practice Exam #C45)
The audit2allow command is used to produce custom SELinux policies which allow a filesystem action to succeed. To that end, it can create and manage custom policy modules.
402
How do you produce a suggested SELinux policy change based upon a log with the audit2allow command? (Pg. 562)
Example: audit2allow < /var/log/audit/audit.log -- This displays a suggested SELinux policy change based upon the main auditd log. Example Output: allow useradd_t usr_t:dir write
403
What is an example of creating a custom SELinux policy module with the audit2allow command and then implementing it? (Practice Exam #C45, Online, and Online)
Example: audit2allow -a -M mypolicy AND THEN semodule -i mypolicy.pp -- This creates a custom SELinux policy module with the name (-M) “mypolicy” based upon all (“-a”) audit logs. The module (“mypolicy.pp”) is then implemented into SELinux by semodule.
404
What is kernel panic? (Pg. 349 and Practice Exam #C50)
A kernel panic is an error event which occurs to prevent data loss and corruption on a system due to an unrecoverable error. This could be caused by software errors, memory overuse, or faulty drivers. This is equivalent to the Windows “Blue Screen of Death.”
405
What utility saves a crashed dump of the Linux kernel by default? (Pg. 349)
kdump
406
What utility is used to synchronize time for a Linux system? (Pgs. 470-471 and Practice Exam #C57)
chrony -- This synchronizes the time for Linux based upon external NTP server(s).
407
How do you display the time server(s) used by chrony? (Pg. 471)
chronyc tracking -- This displays time server details. (The “Reference ID” will name the time server in use.)
408
What is multipathd? (Practice Exam #C57)
The multipathd daemon provides host-side logic that ensures the redundancy, availability, and high-bandwidth connection between a storage device and a host server.
409
What is a Docker volume? (Pg. 596 and Practice Exam #C64)
A Docker volume is a logical partition of storage on a host which Docker can use to share directories with a host. It is also easy to use and share between hosts.
410
How does a bind mount compare with a Docker volume? (Practice Exam #C64)
A bind mount and Docker volume both are reserved storage which allows filesharing between Docker container(s) and a host. However, bind mounts are dependent on the host OS and structure, whereas volumes can be fully managed by Docker.
411
How do you create a Docker volume? (Practice Exam #C64)
docker volume create \ -- This creates the specified volume for a Docker container.
412
What are netboot.me and BKO? (#C87 and Online)
They – netboot.me and BKO – are both interfaces which use gPXE to boot a Linux over HTTP.
413
How do you start a new Kerberos session to request and cache tickets? (Pg. 501 and Practice Exam #C88)
kinit @.com -- This starts a new Kerberos session for the specified user at the specified hostname domain.
414
For example, how do you schedule an at job ten minutes in the future? (Pg. 272)
Example: at now +10 minutes -- This schedules a job ten minutes in the future. Then, enter the command at the “at>” terminal and press Ctrl+D.
415
How do you list all scheduled at jobs? (Pg. 273)
atq -- This displays the queue for the at daemon jobs.
416
How do you delete a scheduled at job from executing? (Pg. 273)
atrm \ -- This removes a specified job from the at daemon queue.
417
How do you define the username and email for a Git repository? (Pg. 579)
git config \--global user.name \ AND git config \--global user.email \ -- These respectively define the username and email for a Git repository.
418
What is initrd? (Pg. 340, Online, and Online Video)
initrd is the initial RAM disk for a system. Comparable to initramfs, it is a temporary root filesystem in RAM which is used to load modules and drivers, which are the minimum software needed by the kernel to boot the system. Once the kernel is fully loaded, initrd is unmounted.
419
What process has a PID of zero (0)? (Pg. 341)
System Scheduler -- This is started by initrd and is a part of the Kernel.
420
What is the first process launched by the system scheduler and has a PID of one (1)? (Pg. 341)
/sbin/init -- This reads the /etc/inittab file and has a process of 1.
421
What does the /etc/inittab file do? (Pgs. 341-342)
This file /etc/inittab initializes the system, starting up scripts for various utilities in their proper runlevels.
422
What is the default niceness for a program which starts? (Pg. 262)
0
423
What is the default niceness for a program which is manually started by the nice command? (Pg. 262)
10
424
How do you run a command with a manually defined niceness level? (Pgs. 262-263)
nice -n -- This runs the specified command at the specified nice_level priority.
425
Using a PID, how do you change the niceness level of a process? (Pg. 264 and Online)
Example: renice -n 15 8389 -- This changes the specified process (with PID 8389) to the specified niceness of 15. (The “-n” is optional if the numbers are in order.)
426
How do you ensure that a systemd service turns on or does not turn on at boot? (Pg. 347)
systemctl enable \ OR systemctl disable \ -- The former enables a systemd unit at boot, whereas the latter disables the unit to not turn on at boot.
427
What does the blkid command show? (Pg. 197)
The blkid command shows the UUID and filesystem type of a specified partition (e.g., blkid /dev/sdb1).
428
What does the fcstat command show? (Online)
It shows statistics and metadata for a specified fibre channel device (e.g., fcstat fcs0).
429
What does GPT mean in a Linux disk context? (Pg. 183)
“GPT” = “GUID Partition Table” – It is a partitioning scheme for a disk device, where partitioned blocks are accessed with logical block addresses (LBAs).
430
What does “GUID” mean in a GUID Partition Table? (Pg. 183)
“GUID” = “Globally Unique IDentifier" -- This is much like a UUID.
431
What does an “LBA” mean in a GUID Partition Table context? (Pg. 183)
“LBA” = “Logical Block Address”
432
How are LBAs numbered in a GUID Partition Table context? (Pg. 183)
LBA Scheme: - 0 through 34 -- Offset addresses from the beginning of the disk for primary partition entries. - -1 through -34 -- Offset addresses from the end of the disk for back up partition entries.
433
What is the htop command in comparison with the top command? (Pgs. 257-258)
The htop shows the same information as top but includes color coding, mouse scrolling, and function keys.
434
How do you list kernel parameters for tuning system performance? (Pgs. 625-626)
sysctl -a -- This displays all of the system tunables for system performance.
435
What is the main config file for the sysctl command? (Pg. 625)
/etc/sysctl.conf -- This contains all of the sysctl tunable parameters.
436
How do you see whether IPv4 Forwarding is enabled on a system with the sysctl command? (Pg. 625)
sysctl -a | grep ipv4.ip_forward -- This displays whether IPv4 Forwarding is on or off (1 or 0).
437
What information is handled in /etc/login.defs? (Pgs. 100, 107-108)
Default values for userid and password aging configuration.
438
What is an example of a file which can override /etc/login.defs? (Pg. 626)
Example: /etc/pam.d/passwd -- This can override password configuration information, such as a password minimum length.
439
What is nftables and who was it built by? (Pg. 513)
The nftables utility is a firewall designed by the makers of iptables. nftables is intended to fix performance and scalability issues from iptables.
440
What does nft add rule ip filter INPUT tcp dport 22 ct state new,established counter accept do? (Pg. 513)
Using the nftables firewall, it allows incoming SSH connections.
441
What does ssh-agent do? (Pg. 492 and Online)
The ssh-agent manages SSH keys on a client or server system.
442
How do you add an SSH key to ssh-agent? (Pg. 492)
Example: ssh-add ~/.ssh/id_rsa -- This adds the specified key to the SSH agent on the specified system.
443
What is Dynamic Port Forwarding? (Pg. 497 and Online)
Dynamic Port Forwarding is a matter of forward traffic from a local port to an unspecified destination port. The SSH client becomes a SOCKS proxy server, listening for an available destination port.
444
What is an example of setting up dynamic port forwarding with SSH? (Pg. 497)
Example: ssh -D 55555 shah@ssh.server.com -- This connects to the destination host of shah@ssh.server.com from the local port of 55555.
445
What is PolicyKit’s modern name and what do PolicyKit rules generally manage? (Pg. 534 and Online)
PolicyKit, a.k.a., “polkit,” rules manage authorizations between privileged and unprivileged users and programs like sudo.
446
What does the PolicyKit command pkexec allow one to do? (Pg. 534)
The pkexec command allows you to run a command as another user.
447
What is an example of the format of a pkexec command? (Pg. 534)
Example: pkexec -user allen cat /etc/hosts -- This displays the /etc/hosts file as if it were being run as the user “allen.”
448
What does the chcon command do? (Pg. 558)
The chcon command changes the SELinux context (user, role, type, sensivity level) of a file or directory.
449
What is an example of changing the SELinux context? (Pg. 558)
chcon -R -r unconfined_r -t unconfined_t ./adir -- This recursively (-R) sets the directory “./adir” to be in a role (-r) of “unconfined_r” and type (-t) of “unconfined_t.”
450
How do you set a file or directory back to its original SELinux context? (Pg. 559)
restorecon -- This restores the default SELinux context of the specified file/directory.
451
What is the double/triple arrow - \<< or \<<< - called? (Pg. 88)
It is a heredoc.
452
What does the double heredoc (<<) do? (Pg. 88)
Example: cat << RNDI -- The double heredoc allows you to enter input on following lines until a specific character(s) is read. In the example, the user can have lines inputted to cat until the user enters “RNDI.”
453
What does the triple heredoc (\<<<) do? (Pg. 88)
Example: cat \<<< ‘hello RNDI’ -- The triple heredoc allows you to enter a whole string to a command. In the example, the string ‘hello RNDI’ is inputted to cat and is then printed out.
454
What is an example of creating files with xargs? (Pg. 141)
Example: echo file{a,b,c} | xargs touch -- The xargs command processes the touch command on each output of echo, therefore creating “filea,” “fileb,” and “filec.”
455
How do designate an output placeholder with the xargs command? (Pg. 141)
Example: xargs -I {} -- This uses double braces (“{}”) as a placeholder for the output of a piped command. ("-I" = Uppercase I)
456
What is an example output to this command?: ls file* | xargs -I {} mv {} test.{}
Example: test.filea test.fileb test.filec -- The name of each file is taken as the double braces (“{}”) and renamed with “test.” in front of each.
457
How do you display the actions of xargs before it is executed? (Pg. 142)
Example: find * | xargs -p \rm -- This displays the action(s) going to be processed by xargs before it is executed. For instance, the output could be: rm ./filea ./fileb ./filec ?...
458
What does the tee command allow one to do? (Pg. 91)
It allows you to print the output of a command to the console and to a file. (For Example: cat /etc/hosts | tee filea)
459
How many sets of how many hexadecimal digits are in a full IPv6 address? (Pg. 460)
There are eight sets of four hexadecimal digits in an IPv6 address.
460
How many bits are in an IPv6 address? (Online)
128 bits
461
How do you convert an IPv6 address to binary? (Online)
Each hex digit of an address is equivalent to four digits in binary. The characters A through F represent 10 through 15, respectively. For example: 0db8 = 0000|1101|1011|1000
462
What are the four main phases of a Linux boot? (Pg. 332)
Phases: - Bootstrap Phase: BIOS - Bootloader Phase: GRUB - Kernel Phase: Kernel - Initialize System Phase: Systemd
463
What does POST stand for? (Pg. 332)
“POST” = “Power-On Self-Test”
464
What is the command cloud-init? (Pg. 594)
The cloud-init command initializes a VM instance located in the cloud.
465
What is the main config file for cloud-init? (Pg. 594)
/etc/cloud/cloud.cfg
466
What is the sar command and what does it stand for? (Pgs. 610-611)
“sar” = “System Activity Report” -- The command can used to get performance reports for CPU, I/O, disk, RAM, etc.
467
How do you display activity CPU/RAM/IO/disk statistics with the sar command with five entries every two seconds? (Pgs. 610-611, 631, 633)
sar -A 2 5 -- This displays performance statistics (CPU/RAM/IO/disk) every two seconds with five entries.
468
What are the eight main CPU % metrics in the top command and what do they mean? (Pg. 256 and Online)
Top Metrics: - us = “User” -- The percent amount of CPU time used by user space processes to do high-level tasks. - sy = “System” -- The percent amount of CPU time used by the kernel to do low-level tasks. - ni = “Nice” -- The percent amount of CPU time used by processes with a positive/low-priority niceness value. - id = “Idle” -- The percent amount of CPU time that is not actively being used. - wa = “Iowait” -- The percent amount of CPU time waiting for input/output operations. - hi = “Hardware Interrupt” -- The percent amount of CPU time used for servicing hardware interrupts. - si = “Software Interrupt” -- The percent amount of CPU time used for servicing software interrupts. - st = “Steal” -- The percent amount of CPU time stolen by a virtual machine to run virtual CPUs.
469
What is the first sector of a hard drive with BIOS? (Pg. 182)
“MBR” = “Master Boot Record”
470
What was used to overcome the four partition limit in MBR? (Pg. 182)
Logical partitions under the fourth primary partition. This is Extended Master Boot Record (EMBR).
471
What are the three sections of a Master Boot Record? (Pg. 333)
MBR Sections: - Boot loader - Partition table - Disk signature
472
How can you troubleshoot SELinux issues using the sealert command? (Pg. 561, Online, and Online)
Example: sealert -a /var/log/audit/audit.log -- This displays the alerts from the main auditd log file for SELinux. The “-a” is to analyze the specific log file.
473
How do you get details for a specified alert using the sealert command? (Online and Online)
sealert -l \ -- This retrieves an SELinux alert based upon the specified alert ID. If the alert ID is an asterisk (“\*”), then all alerts are returned. (-l = Lowercase L)
474
How can you troubleshoot an SELinux issue using the audit2why command? (Pg. 561)
Example: audit2why < /var/log/audit/audit.log -- This audits and displays why an issue occurred with SELinux based upon the main auditd log file SELinux.
475
Which editor can be used to “hot” edit and manage partitions without having to write to disk? (Pgs. 192-193)
parted
476
How do you pick a specific partition within the parted editor? (Pg. 193)
Example: select /dev/sdb -- This select the disk “/dev/sdb” to be edited. If a partition is not specified, parted will use the first partition (i.e., /dev/sda), which can be dangerous.
477
How can you display the partition layout for all devices with the parted command? (Online)
parted -l -- This lists out all of the partition layouts for all block devices. (-l = Lowercase L)
478
How can you have the partition table manually reread a new or edited partition? (Pg. 192)
partprobe OR partprobe -- With or without the specific partition path defined, the partprobe command will manually add any new partition changes to the partition table.
479
What is the gdisk command used to do? (Pgs. 194-195)
The gdisk command is used to manage GPT partitions. It can also manage partition tables, such as converting an MBR partition table to a GPT partition table.
480
How do you get a listing of all of the swap partitions and files on a system? (Pg. 614)
swapon -s – This displays a listing of all of the swap partitions and swap files in use.
481
How do you (re)create the GRUB2 config file? (Pg. 338)
Example: grub2-mkconfig -o /boot/grub2/grub.cfg -- This (re)creates the GRUB2 config file with any changes made to /etc/default/grub or /etc/grub.d/40_custom.
482
What does the /etc/grub.d/40_custom file do? (Pgs. 337-338)
The /etc/grub.d/40_custom is a template file for customizing the boot menu options for GRUB2.
483
How do you reinstall GRUB2 on a specified disk device? (Pg. 336)
Example: grub2-install /dev/sda -- This installs the GRUB2 bootloader onto disk /dev/sda.
484
In Linux, what is Orca? (Pg. 655)
Orca is a screen reader designed to help the visually impaired.
485
What does GOK stand for? (Pg. 655)
“GOK” = “GNOME Onscreen Keyboard”
486
What are the SysVinit printing commands to allow for and block printing jobs and to allow or disallow printers? (Online and Online)
SysVinit Commands: - accept -- Accept print jobs. (Replaced by cupsaccept.) - reject -- Reject print jobs. (Replaced by cupsreject.) - enable -- Enables a printer. (Replaced by cupsenable.) - disable -- Disables a printer. (Replaced by cupsdisable.)
487
What are the CUPS printing commands to allow for and block printing jobs and to allow or disallow printers? (Pgs. 392-394)
CUPS Commands: - cupsaccept -- Accepts print jobs in CUPS. - cupsreject -- Reject print jobs in CUPS. - cupsenable -- Enables a printer in CUPS. - cupsdisable -- Disables a printer in CUPS.
488
How do you cancel print jobs? (Pg. 393)
cancel -- This cancels a specified print job or all print jobs in a specified queue.
489
How do you move a printer queue from one printer to another? (Pg. 394)
Example: lpmove tty2printer tty3printer -- This has the printer queue of jobs moved from printer “tty2printer” to printer “tty3printer.”
490
How do you print the status of a printer with the lpstat command? (Pg. 393)
Example: lpstat -p tty2printer -- This prints the status of a specified printer.
491
How do you print the status of a printer’s queue with the lpstat command? (Pg. 393)
Example: lpstat -P tty2printer -- This prints the status of a specified printer queue.
492
How do you print all print jobs of all printer queues with the lpstat command? (Pg. 393)
lpstat -o -- This prints the status of all jobs in all print queues.
493
What does the set command do? (Pg. 73-74)
The set command displays all of the shell variables in the current process.
494
How do you turn a shell variable on or off with the set command? (Online)
Set Settings: - Example: set -o noclobber -- This turns ON the noclobber setting. - Example: set +o noclobber -- This turns OFF the noclobber setting.
495
How do you delete a variable from the current shell? (Pg. 74)
unset \ -- This will delete the variable from the current process.
496
What does the command declare -p do? (Pg. 75)
declare -p \ -- This will display the properties of a specified variable.
497
How do you display all of the exported variables in a Linux shell? (Online)
export -p -- This prints all of the variables which have been exported within the Linux shell.
498
How do you produce a “locate” command database for a user’s home directory? (Pg. 142 and Online)
Example: updatedb -U /home/user1 -o /home/user1/locatedb -- This produces a locate command database file called “locatedb” for the files in the user “user1’s” home directory subtree (-U).
499
What do you need to do to automatically mount an encrypted device? (Pg. 206)
You need to add an entry for the encrypted device in the /etc/crypttab file and then an entry in the /etc/fstab file.
500
What is the main configuration file for DHCP? (Pg. 624)
/etc/dhcp/dhclient.conf
501
How do you release and renew an IP address that is used by DHCP? (Pg. 624 and Online)
dhclient -r AND THEN dhclient -- The first command releases the IP address currently assigned to the system. The second command renews the IP address that was in use.
502
What does the free command do? (Pg. 201)
The free displays the total amount of memory and swap space that is available and used.
503
What are the xwininfo and xdpyinfo commands? (Pg. 652)
X Server Commands: - xwininfo -- This displays information about open windows on an X server desktop. - xdpyinfo -- This displays information on the capabilities of an X server.
504
What are five of the main GUIs for Linux? (Pg. 653)
Gnome, Unity, Cinnamon, MATE, KDE
505
How do you allow for IPv4 forwarding with the sysctl command? (Pg. 625 and Online)
sysctl -w net.ipv4.ip_forward = 1 -- This writes (“-w”) the “net.ipv4.ip_forward” parameter to being enabled (“1”).
506
What does the uname command show? (Online)
The uname command shows the kernel information for a system. (Probably derived from “Unix NAME.”)
507
How do you display all system information with the uname command? (Online)
uname -a -- This displays all of the system information for a system, including kernel name, OS, machine, etc.
508
How do you display the operating system, specifically, with the uname command? (Online)
uname -o -- This displays the operating system of a system.
509
How do you decompress a zipped file in Linux? (Pg. 232, Online, and Online)
Example: unzip -v filename.zip -- This unzips the compressed file “filename.zip” with verbose output (“-v”).
510
What does the “xz” command do? (Pg. 231)
xz is a compression tool on Linux systems, alongside zip, gzip, and bzip2.
511
What is the main configuration file for journalctl? (Pg. 552)
/etc/systemd/journald.conf
512
How do you compress a directory with the zip command? (Pg. 232 and Online)
Example: zip -r filename.zip ./dir – This recursively (“-r”) compresses the directory “dir” under the compressed archive file “filename.zip.”
513
How do you uninstall a package in YUM or DNF? (Pgs. 302-303 and Online)
yum/dnf remove \ OR yum/dnf erase \ -- This uninstalls the specified package and its dependencies on the Red Hat system.
514
How do you remove a dependency package that is no longer in use with YUM or DNF? (Pgs. 302-303 and Online)
yum/dnf autoremove -- This removes packages that were installed as dependencies of other packages but are no longer in use by any packages.
515
How do you delete all cached packages and metadata in YUM or DNF? (Pgs. 302-303 and Online)
yum/dnf clean all -- This removes and cleans up all cached Red Hat packages and metadata.
516
How do you test a network route connection between two endpoints with the ip command? (Online – Q#25 and Online)
Example: ip route get 192.168.10.10 from 10.0.0.10 -- This tests the signal from the source of 10.0.0.10 to the destination 192.168.10.10.
517
How do you get a listing of previous DNF package actions (installs/upgrades/uninstalls)? (Online)
dnf history -- This details a history of all Red Hat package actions (installs, upgrades, uninstalls, etc.) in DNF.
518
How do you list available packages by a specified search term in YUM or DNF? (Pgs. 301, 303)
Example: yum/dnf list available kernel* -- This lists all available Red Hat packages that start with the term “kernel.”
519
What is the difference between update and upgrade in YUM or DNF? (Pg. 302, Online, and Online)
The yum/dnf update command is used to apply updates to all packages on the system. The yum/dnf upgrade command does the same thing but also removes all obsolete packages.
520
What is the YUM/DNF equivalent of the command apt get upgrade? (Online)
yum/dnf update -- This command *applies* updates to YUM/DNF packages like “apt get upgrade” does to APT packages. (The yum/dnf upgrade command could also be an answer, but it removes obsolete packages as well.)
521
How do you upgrade installed RPM packages, with and without new packages for the OS? (Pg. 292)
RPM Commands: - rpm -U -- This upgrades (and if needed installs) RPM packages as well as any new operating system packages. - rpm -F -- This upgrades just the installed RPM packages on a system.
522
How do you check the legitimacy of a package with the RPM command? (Pg. 292)
Example: rpm -V mysql-server -- This verifies (“-V”) that the specified package “mysql-server” matches the information from the package database.
523
How do you install and uninstall packages with the RPM command? (Pg. 292)
RPM Commands: - rpm -i \ -- This installs a specified RPM package file. - rpm -e \ -- This erases/uninstalls a specified RPM package file.
524
How do you get information about a specific RPM package and a list of its dependencies? (Pg. 292 and Online)
Example: rpm -qR gimp -- This queries (“-q”) for RPM package information. In this example, the “-R” searches for dependencies of the package “gimp.”
525
How do you create tape archive from a directory without compressing it? (Pgs. 232-233)
Example: tar -cf book_backup.tar /Books -- This creates the uncompressed tarball “book_backup.tar” out of the “/Books” directory.
526
How do you create a compressed tape archive? (Pg. 233)
Example: tar -czvf book_backup.tar.gz ~/Books -- This creates the compressed tarball “book_backup.tar.gz” from the “~/Books” directory. (“-c” = Create a tarball. “-z” = Compress it with gzip. “-v” = Produce verbose output. “-f” = “Specifies the name of the tarball.”)
527
How do you print out a file in compressed form to STDOUT, without changing the file with the Gzip utility? (Online)
gzip -c -- This prints out the compressed form of a specified file to STDOUT, without changing the file.
528
How do you extract contents out of a compressed tape archive? (Pg. 233)
Example: tar -xzvf book_backup.tar.gz -- This extracts the compressed tarball “book_backup.tar.gz” and puts the output in the present directory. (“-x” = Extracts contents of tarball. “-z” = Decompress it with gzip. “-v” = Produce verbose output. “-f” = “Specifies the name of the tarball.”)
529
How do you display the percentage compression reduction for each file (de)compressed with the GZIP utility? (Online)
gzip -v -- While (de)compressing a specified file, the verbose (“-v”) output will include the name and reduction percentage for each file (de)compressed.
530
What are two ways to decompress a GZIP file? (Online)
gzip -d .gz OR gunzip .gz -- This decompresses/unzips the specified GZIP file.
531
What does “find /shared_data type f -mtime +90 -exec rm {} \;” do? (Online – Q#47)
This finds all of the files under the directory “/shared_data” which have been modified (“-mtime”) more than 90 days ago and deletes them. (The “\;” designates the end of the exec command.)
532
How do you load a specified SYSCTL configuration file? (Online)
sysctl -p \ -- This loads and implements the configuration from the specified configuration file to the sysctl utility.
533
How is the $DISPLAY environment variable used? (Online – Q54 and Online)
The $DISPLAY environment variable is used to point to the IP address and screen number of a system in order to enable X11 Forwarding to that system.
534
What does the $USER environment variable show? (Online)
The $USER variables shows the username of the currently logged-in user.
535
What does the $PATH environment variable show? (Online)
The $PATH variable shows the directories where the system looks for executable files.
536
What does the $EDITOR environment variable show? (Online)
The $EDITOR variable shows the default environment text editor for the Linux system.
537
What does the $TEMP environment variable show? (Online)
The $TEMP variable shows the directory location for temporary files.
538
What single-word command can be used to edit the /etc/sudoers file? (Pg. 532)
visudo -- This brings the /etc/sudoers file into a vi editor interface.
539
How can you check the /etc/sudoers file for syntax errors? (Online)
visudo -c -- This checks the /etc/sudoers file for syntax errors and sudo rule validity.
540
How do you specify an alternate /etc/sudoers file? (Online)
visudo -f \ -- This specifies a specified file as an alternate sudoers file and will bring up a vi editor interface to edit that interface.
541
What does the line “amos ALL = NOPASSWD: /bin/kill, PASSWD: /usr/bin/lprm” in /etc/sudoers file? (Pg. 533)
The line means that the user named “amos” will have permission to execute the “kill” and “lprm” commands. However, he won’t need a password for “kill” and will need a password for “lprm.”
542
How do you delete all Docker images not associated with a specific container? (Online)
docker image prune -a -- This prunes/deletes all (“-a”) dangling Docker images on a system that are not associated with a specific container.
543
How do you check and remove the last package installed in DNF? (Online and Online)
dnf history undo last -- This undoes the installation of the last transaction done by DNF. The “last” keyword is a transaction ID for the last transaction in the DNF history.
544
What is the strace command used to do? (Online)
The strace command is used to monitor and manipulate system calls between processes and the Linux kernel. (Example: strace -p 26380)
545
How do you specify a private key for connecting with the ssh command? (Online – Q89 and Online)
Example: ssh -i “my-key.pem” root@10.0.10.15 -- This specifies to connect to the root user on host 10.0.10.15 with the identity key (“-i”), which is an SSH private key.
546
What does the /etc/netplan configure? (Online)
The /etc/netplan file configures a network based upon a set of YAML files under /etc/netplan/*yaml.
547
How do you create a basic netplan file on a Linux system? (Online)
netplan generate -- This produces a basic netplan configuration file under /etc/netplan.
548
How do you test a netplan configuration to validate it before employing it? (Online and Online)
netplan try -- This tests the configuration of /etc/netplan and checks whether it is valid without putting it into action.
549
How do you start a netplan configuration on a Linux system? (Online)
netplan apply -- This applies the configuration set by /etc/netplan and puts it into action, restarting any processes needed.
550
How do you specify swap priority when adding a swap partition to /etc/fstab? (Pg. 205)
You set the priority setting in the filesystem type field of /etc/fstab. Example: /dev/sda3 swap pri=60 defaults 0 0
551
How do you create a swap partition with a specified priority? (Pgs. 201)
Example: mkswap /dev/sdb2 -p 60 -- This creates a swap partition from /dev/sdb2 with a priority (“-p”) of 60.
552
What should be the file permissions for a swap file? (Pg. 202)
600 -- With root as the owner, a swap file should only have read and write access to root.
553
How do you display the users and processes that are using a filesystem at a particular time? (Pg. 206)
fuser -vm \ -- This specifies all users and processes using a specified filesystem at the present time.
554
How do you see just the superblock data for a specified filesystem with the dumpe2fs command? (Pg. 209 and Online)
Example: dumpe2fs -h /dev/sda3 -- This displays the superblock for the specified filesystem /dev/sda3.
555
How do you display the metadata and statistics for a specified filesystem? (Pg. 209 and Online)
dumpe2fs \ -- This displays metadata and statistics for a specified filesystem based upon the information stored in the filesystem’s superblock and block groups.
556
What is the equivalent command to tune2fs for an XFS filesystem? (Pgs. 209-210)
xfs_admin -- This command modifies parameters for an unmounted XFS filesystem, including allowing you to creating a label for a filesystem.
557
What is the partition code number for a regular Linux file? (Pg. 190)
83
558
What does the xfs_info command show? (Pg. 210)
The xfs_info command displays XFS filesystem geometry, such as inode size and block size.
559
What is the partition code number for a Linux swap file? (Pg. 190)
82
560
What is the partition code number for a Linux LVM? (Pg. 190)
8e
561
How do you add a user to a group with the gpasswd command? (Percipio Lab)
Example: gpasswd -a jimdoe Marketing -- This adds the user “jimdoe” to the group “Marketing.”
562
How do you add an administrator user to a group with the gpasswd command? (Percipio Lab)
Example: gpasswd -A juliedoe Sales -- This adds the administrative user “juliedoe” to the group “Sales.”
563
How do you remove a user from a group with the gpasswd command? (Percipio Lab)
Example: gpasswd -d jimdoe Marketing -- This deletes the user “jimdoe” from the group “Marketing.”
564
What does the newgrp command do? (Percipio Lab)
The newgrp command changes the current user’s group to a specified group for just that login session. (e.g., newgrp adm -- Changes group to “adm.”)
565
How do you give a Linux group a new name? (Pg. 114)
groupmod -n \ \ -- This change the name (“-n”) to a specified new name.
566
What is the root user’s UID? (Pg. 100)
0
567
What are user IDs 0-99 used for? (Pg. 100)
The UIDs 0-99 are administrative user accounts reserved and created by the OS rather than by any application.
568
How do you create a system service account with the useradd command? (Pg. 100)
useradd \<-r|\--system\> \ -- This creates a nonprivileged user account for a system service. It applies the needs of a user account for the service, but there is no login and no home directory.
569
What is defined as the default shell for a system service account in /etc/passwd? (Pg. 102)
In /etc/passwd, the default shell of a system account is either /sbin/nologin or /bin/false. Both of those “shells” prevent login.
570
What is the difference between doing “su ” and “su - ?” (Pg. 104)
SU Differences: - su \ -- Changes UID, primary group ID, and home directory to the specified user’s account. - su - \ -- Beyond UID, GID, and directory, it also reads the user’s profile and config, fundamentally becoming exactly like the specified user.
571
How do you display all of the default variables when doing the useradd command? (Pg. 107)
useradd -D -- This displays all of the default variables under /etc/default/useradd.
572
How do you change useradd default variables like home directory and account expiration date? (Pg. 107)
useradd Options: - useradd -Db \ -- This changes the HOME variable to the specified directory (e.g., “/home”). - useradd -De \ -- This changes the EXPIRE variable to a specified date.
573
How is the tcpdump command used? (Percipio Course)
Example: tcpdump -i ens33 -v -- This dumps traffic packets going through the specified network interface “ens33” with verbose (“-v”) output.
574
With what command can you display all of the name servers configured (in /etc/resolv.conf)? (Pg. 469)
resolvectl status -- This displays all of the DNS addresses configured on the system found /etc/resolv.conf.
575
How do you do a domain lookup (forward or reverse) with the resolvectl command? (Pg. 469)
Example: resolvectl query www.google.com -- This does a domain lookup of the hostname FQDN www.google.com.
576
How do you do a reverse lookup with the dig command? (Online)
dig -x \ -- This does a reverse lookup, finding the domain name from the specified IP address.
577
What does the whois command show? (Pg. 469)
Example: whois www.google.com -- This looks up and lists the name, phone number, and address for a specified domain name.
578
What is the host command used to do? (Pg. 468)
The host command is a basic domain lookup tool much like dig but quicker and with less detail.
579
Which directories under root are pointers to a directory under the /usr directory?
/bin, /lib, /lib{32,64,etc.}, /sbin (Ex: /bin -> /usr/bin)
580
How do you list out subdirectories and their contents with the ls command? (Pg. 128)
ls -R
581
With what command can you see the metadata for a Linux file? (Pg. 129)
stat -- This displays file metadata, such as inodes, links, and modify dates.
582
What are the three dates which are a part of a file’s metadata? (Pgs. 128-129)
File Dates: - access -- The date specifies the last time the file was accessed. - modify -- The date specifies the last time the file’s content was modified. - change -- The date specifies the last time the file metadata was changed (e.g., owner change).
583
How do you create a directory with subdirectories with the mkdir command? (Pg. 133)
Example: mkdir -p ~/temp/backups/daily -- This creates all of the directories of the path (“-p”) temp/backups/daily under the home directory.
584
What does the “file” command do? (Pg. 134)
It displays the file type of a specified file.
585
What does it mean when there is a backlash (“\”) in front of a command? (Pgs. 135, 144)
Example: \rm file1 -- The backlash (“\”) indicates that the command should be run “as-is” – without any alias it may be linked to. In this case, “rm” is typically linked to “rm -i," so it will just be run as “rm.”
586
How do you display the currently enabled firewall rules with the ufw command? (Pg. 513)
ufw status -- This displays the UFW firewall rules that are enabled on the system.
587
How do you permit traffic for a specific protocol with the ufw command? (Pg. 513 and Online Lab)
Example: ufw allow https -- This allows HTTPS traffic on the host.
588
How do you block traffic through a specific port and add a rule descriptor with the ufw command? (Pg. 513 and Online Lab)
Example: ufw deny 23/tcp comment “Deny Telnet” -- This denies traffic on TCP port 23, adding the comment “Deny Telnet” for the rule.
589
What is the default ufw config file and where can it be overwritten? (Pg. 513)
/etc/default/ufw -- This is the default config file with default rules for ufw. /etc/ufw/*.rules -- Adding .rules files under /etc/ufw will override the default ufw rules.
590
How do you mount all filesystems in /etc/fstab with the mount command? (Online)
mount -a -- This mounts all filesystems listed in /etc/fstab.
591
How do you list all mounted filesystems of a specific type with the mount command? (Online)
mount -l -t ext4 -- This lists (“-l”) all mounted filesystems of type (“-t”) EXT4.
592
How do you unmount all filesystems in /etc/fstab with the umount command? (Online)
umount -a -- This unmounts all filesystems listed in /etc/fstab.
593
How do you enforce an unmount of a filesystem even when it’s busy with the umount command? (Online)
umount -f -- This unmounts the specified filesystem forcefully (“-f”), even if the device is busy.
594
How do you enforce an unmount of a filesystem where the references are cleaned up at a later time with the umount command? (Online and Online)
umount -l -- This does a lazy (“-l”) unmount of a filesystem, where the filesystem is detached immediately but references are cleaned up when the filesystem is not busy. ("-l" = Lowercase L)
595
How do you do a dry run of unmounting a filesystem with the umount command? (Online)
umount -n \ -- This does a dry run of an unmount, showing what would be done without actually unmounting the filesystem.
596
What does the command option “umount -r” mean? (Online)
umount -r \ -- This specifies that if an unmount for the filesystem is unsuccessful, then it will look to remount the filesystem in read-only (“-r”) mode and try again.
597
What command should you run to fix a filesystem after its partition/LVM has changed in size? (Pg. 229 and Online)
resize2fs \ -- This resizes the filesystem to match the size of a partition or LVM which has shrunk or grown in size.
598
What is the e2fsck command? (Online)
The e2fsck command is used to run fsck on EXT2, EXT3, and EXT4 filesystems to repair them.
599
How do you ensure that a fsck is run even on a clean filesystem with the e2fsck command? (Online and Online)
e2fsck -f -- This forces “-f” a filesystem check on the EXTn filesystem specified.
600
What does the screen command do? (Online)
The screen command pulls up a new terminal screen interface which allows you to run multiple terminals at one time. It works like having multiple tabs open.