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.
What order are the Bash shell config files introduced upon login? (Pgs. 83-84)
/etc/profile, ~/.bash_profile, ~/.bashrc, /etc/bashrc
What do each of the Bash config files generally do? (Pgs. 83-84)
/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 would you set the date on a Linux system?
Example: timedatectl set-time 2023-01-01
What are the four attributes for a file/directory in ls -Z per SELinux? (Pg. 558)
user (_u), role (_r), type (_t), sensitivity level (s0)
How do you add a secondary group without deleting any groups present with usermod? (Pg. 110)
usermod -aG <group_name> -- (-aG) Adds a secondary group (without replacing original(s).</group_name>
How do you change a username with usermod? (Pg. 110)
usermod -l <new_user_name><old_user_name> -- (-l) Renames the username (a.k.a., login name) for a user.</old_user_name></new_user_name>
And how do you rename a user and move their home directory to a new user with usermod? (Pg. 110)
usermod -l <new_user_name> -d <original_home_dir> -m <old_user_name> -- (-m) Moves the user's home directory to being a new user's home directory.</old_user_name></original_home_dir></new_user_name>
What is Samba (Pgs. 472-473)?
Samba is a remote access tool to Windows file and print services for Linux.
What does OOM stand for? (Pg. 612)
“Out Of Memory Killer”
What does the OOM process generally do? (Pg. 612)
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.
What does lsof mean? (Pg. 228)
“lsof” = “LiSt Open Files”
What flag do you need for lsof to check open network ports? (Pg. 503)
lsof -i – This will list network services and their ports.
What does pwconv generally do?
pwconv – This command converts the /etc/passwd file to a /etc/shadow file.
How do you create and decrypt an encrypted cpio file? (Pg. 233)
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.
What does mtr stand for? (Pg. 466)
“mtr” = “My TraceRoute”
Which two commands does mtr copy and combine in functionality? (Pg. 466)
It combines traceroute and ping, scanning the network path a packet takes and checking packet transmission to an external server.
How many properties are there in /etc/shadow? (Pgs. 102-103)
There are 8 properties.
What are the properties of /etc/shadow? (Pgs. 102-103)
user_name, password, last_modified, min_days, max_days, warn_days, inactive (measured in days), expire
Why might a user not be able to save their work on a filesystem?
The filesystem was mounted in read-only mode. Example: mount -o ro /public
To undo: mount -o remount,rw /public
Blacklisting the module disables the module, but how do you prevent a module from being installed?
Do this: echo “blacklist joydev”»_space; /etc/modprobe.d/blacklist.conf – Blacklists the module.
And this: echo “blacklist joydev”»_space; /etc/modprobe.d/network.conf – Blacklists the module in the network config.
BUT ALSO: echo “install joydev /bin/false”»_space; /etc/modprobe.d/blacklist.conf – Prevents the module from being installed.
How are RADIUS and TACACS+ used, simply?
RADIUS and TACACS+ use a modem to proxy to a separate server to authenticate a user. TACACS+ furthers RADIUS by incorporating password encryption.
How do you determine the IP address subnet mask from the CIDR number?
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 do you display all addresses with the ip command? (Pgs. 450-451)
ip addr show – Displays all network interface addresses.
How do you add an address to a device with the ip command? (Pgs. 450-451)
ip addr add <network_address> dev <interface> -- Adds an address to a device.</interface></network_address>