Study Guide Flashcards
A Linux administrator must identify a user with high disk usage. The administrator runs the # du -s /home/* command and gets the following output:
43 /home/User1
2701 /home/User2
133089 /home/User3
3611 /home/User4
Base on the output, User3 has the largest amount of disk space used. To clean up the file space, the administrator needs to find out more information about the specific files that are using the most disk space.
Why of the following commands will accomplish this task?
A. df -k /home/User/files.txt
B. du -a /home/User3/
C. du -sh /home/User/
D. find . -name /home/User3 -print
C. du -sh /home/User
Ends with “User/”
A Linux server has multiple IPs. A Linux administrator needs to verify if the HTTP server port is bound to the correct IP.
Which of the following commands would BEST accomplish this task?
A. route B. host C. nslookup D. netstat E. ip
D. netstat
netstat can find listening ports
A systems administrator needs to append output of ls -lha /opt command to the contents of a test.txt file. Which of the following commands will accomplish this?
A. ls -lha /opt > text.txt
B. ls -lha /opt < test.txt
C. ls -lha /opt»_space; test.txt
D. ls -lha /opt «_space;test.txt
C. ls -lha /opt»_space; test.txt
Double-Greater-Than sign»_space;
A Linux systems administrator needs to provision multiple web servers into separate regional datacenters. The systems architect has instructed the administrator to define the server infrastructure using a specific tool that consumes a text-based file.
Which of the following is the BEST reason to do this?
A. To document the infrastructure so it can be included in the system security plan.
B. To ensure the administrator follows the planning phase of the system development life cycle.
C. To define the infrastructure so it can be provisioned consistently with minimal manual tasks.
D. To validate user requirements have been met within each regional datacenter for compliance.
B. To ensure the administrator follows the planning phase of the system development life cycle.
Pick the SDLC
A Linux systems administrator needs to set permissions on an application with the following parameters:
- The owner of the application should be able to read, write, and execute the application.
- Members of the group should be able to read and execute the application.
- Everyone else should not have access to the application.
Which of the following commands would BEST accomplish these tasks?
A. chmod 710
B. chmod 730
C. chmod 750
D. chmod 760
C. chmod 750
750.
Read - 4, Write - 2, Execute - 1
Owner / Group / Other
7 (4+2+1) 5 (4 + 1), 0
A junior Linux adminsitrator is trying to verify connectivity to the remote host host1 and display round-trip statistics for ten ICMP.
Which of the following commands should the administrator execute?
A. ping -c 10 host1
B. traceroute -c 10 host1
C. netstat host1
D. pathping -c 10 host1
A. ping -c 10 host1
ICMP ping checks remote connectivity to host for -c (count) of 10.
A junior Linux administrator is updating local name resolution to support IPv6. The administrator issues the command cat /etc/hosts and receives the following output:
127.0.0.1 localhost
Which of the following actions should the administrator perform to accomplish this task?
A. Modify the /etc/hosts file, and add the pv6 localhost entry to the file.
B. Modify the /etc/hosts file, and add the ::1 localhost entry to the file.
C. Modify the /etc/hosts file, and add the ipv4 localhost entry to the file.
D. Modify the /etc/hosts file, and add the 0.0.0.0 localhost entry to the file.
D. Modify the /etc/hosts file, and add the 0.0.0.0 localhost entry to the file.
Look for 0.0.0.0
A Linux systems administrator needs to copy the contents of a directory named “working” on the local working system to a folder /var/www/html on a server named “corporate-web”.
Which of the following commands will allow the administrator to copy all the contents to the web server?
A. scp -r working/* webuser@corporate-web:/var/www/html
B. tar working/* webuser@corporate-web:/var/www/html
C. cp -r working/* webuser@corporate-web:/var/www/html
D. mv working webuser@corporate-web:/var/www/html
A. scp -r working/* webuser@corporate-web:/var/www/html
SCP is the protocol of choice for copying files to remote servers.
A systems administrator has received reports of intermittent network connectivity to a particular website. Which of the following is the BEST command to use to characterize the location and type of failure over the course of several minutes?
A. mtr www.comptia.org
B. tracert www.comptia.org
C. ping www.comptia.org
D. netstat www.comptia.org
B. tracert www.comptia.org
Trace Routes help with logical location, ping does not.
A Linux admnistrator has configured a Linux system to be used as a router. The administrator confirms that two network adapters are properly installed and functioning correctly. In addition, the output of the iptables -L command appears to contain a complete firewall configuration.
Which of the following commands does the administrator need to issue for the router to be fully functional?
A. echo “1” > /proc/sys/net/ipv4/ip_forward
B. echo “0” > /proc/sys/net/ipv4/tcp_abort_on_overflow
C. echo “0” > /proc/sys/net/ipv4/max_connections
D. echo “1” > /proc/sys/net/ipv4/ip_default_ttl
A. echo “1” > /proc/sys/net/ipv4/ip_forward
ip_forward is the only relevant file.
A systems administration team has decided to setup their systems as immutable instances. They keep the desired state of each of their systems in version control and apply automation whenever they provision a new instance. If there is an issue with one of the servers, instead of troubleshooting the issue they terminate the instance and rebuild it using automation.
Which of the following is this an example of?
A. Inventory
B. Orchestration
C. Infrastructure-as-Code
D. Agentless Deployment
C. Infrastructure-as-Code
Self-explanatory.
A systems administrator wants to deploy several applications to the same server quickly. Each application should be abstracted from the host with its own dependencies and libraries and utilize a minimal footprint.
Which of the following would be BEST in this scenario?
A. Virtual machines
B. Type 2 hypervisor
C. Chroot jails
D. Containers
D. Containers
Containers would be preferable to Virtual Machines to reduce footprint. The other answers do not make sense.
An operator finds a user is having issues with opening certain files.
Which of the following commands would allow the security administrator to list and check the SELinux context?
A. ls -D
B. ls -a
C. ls -Z
D. ls -l
C. ls -Z
-Z flag displays SELinux labeling
A new corporate policy states that Bluetooth should be disabled on all company laptps. Which of the following commands would disable the use of Bluetooth?
A. echo “blacklist bluetooth” > /etc/modprobe.d/blacklist-bluetooth
B. echo “kill bluetooth” > /etc/modprobe.d/kill-bluetooth
C. echo “modprobe bluetooth” > /etc/modprobe.d/modprbe-bluetooth
D. echo “rmod bluetooth” > /etc/modprobe.d/rmmod-bluetooth
C. echo “modprobe bluetooth” > /etc/modprobe.d/modprbe-bluetooth
Modprobe is in the path and the echo string.
A junior Linux administrator is installing a new application with CPU architecture requirements that have the following specifications:
- x64 bit
- 3.0GHz speed
- Minimum quad core
The administrator wants to leverage existing equipment but is unsure whether the requirements of these systems are adequate. The administrator issues the following command cat/proc/cpuinfo. The output of the command is as follows.
cpu_family: x64
cpu GHz - 2.1
cpu cores: 4
Which of the following is the recommended course of action the adminstrator should take based on this output?
A. Install the application, as the system meets the application requirements.
B. Procure new equipment that matches the reccomended specifications.
C. Recompile the Linux kernel to support he installation.
D. Reconfigure lib modules to support he new application.
A. Install the application, as the system meets the application requirements.
I do not believe this is the correct answer, as the system has less than 3.0GHz speed. Therefore answer B (procure new equipment that matches the recommended specifications) is the actual answer.
A Linux systems administrator wants the ability to access systems remotely over SSH using RSA authentication. To which of the following files should the RSA token be added to allow this access?
A. authorized_keys
B. ~/.ssh/ssh_config
C. id_rsa.pub
D. known_hosts
C. id_rsa.pub
Pick the answer with RSA for the RSA question.
A Linux server needs to be accessed, but he root password is not available.
Which of the following would BEST allow an administrator to regain access and set a new known password at he same time?
A. Boot into a single-user mode and reset the password via the passwd command.
B. Boot into a single-user mode and reset the password by editing the /etc/passwd file.
C. Boot into a single-user mode and reset the password by editing the /etc/shadow file.
D. Boot into a single-user mode and reset the password via the change command.
A. Boot into a single-user mode and reset the password via the passwd command.
“passwd command”
A Linux adminstrator wants to fetch a Git repository from a remote Git server.
Which of the following is the BEST command to perform this task?
A. git checkout
B. git clone
C. git merge
D. git config
B. git clone
An administrator needs to create a shared directory in which all users are able to write and execute its content but none of the regular usres are able to delete any content.
Which of the following permissions should be applied to this shared directory?
A. rwxrwxrwt
B. rwxrwxrws
C. rwxrwxrwx
D. rwxrwxrw*
C. rwxrwxrwx
Read-Write-Execute x 3
A systems administrator has finished building a new feature for the monitoring software in a separate Git branch.
Which of the following is the BEST method for adding the new feature to the software’s master branch?
A. Merge the changes from the feature branch to the master branch.
B. Save the changes to the master branch automatically with each Git commit.
C. Clone the feature branch into the master branch.
D. Pull the changes from the feature branch into the master branch.
A. Merge the changes from the feature branch to the master branch.
Which of the following will provide a list of all flash, external, internal, and SSD drives?
A. lspci
B. lsmod
C. lsblk
D. lsusb
C. lsblk
Because pci, mod, and usb don’t make sense. Go blk, don’t go back.
Which of the following configuration management tools is considered agentless?
A. Oupuppet
B. Salt
C. Ansible
D. Chef
C. Ansible
CCNA overlap! Ansible.
An administrator reviews the following configuration file provided by a DevOps engineer:
Tasks:
- name: Install php-fpm from repo
…
A. YAML
B. AJAX
C. JSON
D. SOAP
C. JSON
CCNA overlap! JSON.
Which of the following is a difference between YAML and JSON?
A. Users can comment in YAML but not in JSON.
B. JSON uses only curly brackets, while YAML only uses square brackets.
C. JSON is used in web development, while YAML is used solely in back-end systems.
D. YAML has been deprecated for JSON.
A. Users can comment in YAML but not in JSON.
CCNP overlap! JSON’s strict structure doesn’t allow for comments.
A junior administrator of a physical server receives log messages indicating the out-of-memory killer has been active. All memory slots are in use on the motherboard, but additional disk space is available. Space has been allocated for a swap file.
Which of the following should the administrator use to reduce the output of memory messages?
A. free : swapoff / swapfile ; swapon -a
B. mkswap /swapfile; swapon -a
C. fallocate -l 2G /swapfile && swapon -a
D. echo “1” > /proc/meninfo ; swapon / swapfile
A. free : swapoff / swapfile ; swapon -a
Can’t swap on unless you “swap off.”
A junior Linux administrator is optimizing a system in which an application needs to take priority 0 when running the process. The administrator runs the ps command and receives the following output:
PID 8481, PPID 2, TTY pts/17, Time 16:40:00, CMD app
Given this scenario, which of the following steps will address this issue?
A. Issue the command renice -n 0 -p 8481
B. Issue the command renice -p 8481
C. Issue the command renice -p 0 -n 8481
D. Issue the command renice -n 8481
A. Issue the command renice -n 0 -p 8481
N (Niceness value) = 0
P (PID) = 8481
An administrator needs to mount the shared NFS file system testhost:/testvolume to mount point /mnt/testvol and make the mount persistent after reboot.
Which of the following BEST demonstrates the commands necessary to accomplish this task?
A. mkdir -p /mnt/testvol
echo “testhost1/testvolue /mnt/testvol nfs defaults 0 0”»_space; /etc/fstab
mount -a
B. mkdir /mnt/testvol
mount testhost1/testvolume /mnt/testvol
C. mkdir testhosts/testvolume at /mnt/testvol
mount -a
D. mkdir /mnt/testvol
echo “testhost:/testvolume /mnt/testvol”»_space; /mnt/mntab
mount -a
D. mkdir /mnt/testvol
echo “testhost1/testvolume /mnt/testvol”»_space; /mnt/mnttab
mount -a
Pick the echo answer without the crazy syntax.
A system administrator has deployed a Linux server based on an Anaconda process with all packages and custom configurations necessary to install a web server role.
Which of the following could be used to install more Linux servers with the same charcteristics?
A. /etc/sysconfig/anaconda/cfg
B. /root/anaconda.quto
C. /root/anaconda-ks.cfg
D. /etc/sysconfig/installation.cfg
C. /root/anaconda-ks.cfg
Anaconda don’t want none, unless you have the ks.cfg run.
A Linux administration is using a Linux system as a router. During the tests, the administrator discovers that IP packets are not being sent between the configured interfaces.
Which of the following commands enables this feature for IPv4 networks?
A. cat/proc/sys/net/ipv4/ip_route > 1
B. echo “1” > /proc/sys/net/ipv4/ip_forward
C. echo “1” > /proc/sys/net/ipv4/ip_route
D. echo “1” > /proc/sys/net/ipv4/ip_net
B. echo “1” > /proc/sys/net/ipv4/ip_forward
“Forward” because this is technically not routing.
A systems administrator wants to know the current staus of a series of dd jobs that were started in the background three hours ago.
Which of the following commands will achieve this task?
A. sudo killall -HIP dd
B. sudo killall dd
C. sudo killall -TERM dd
D. sudo killall -USR1 dd
D. sudo killall -USR1 dd
Look for “usr1”
A Linux adminstrator needs the “tech” account to have the option to run elevated commands as root.
Which of the following commands would BEST meet this goal?
A. su - tech -c “/bin/bash”
B. usermod -aG wheel tech
C. sudo -I tech
D. groupadd -u tech -g root
B. usermod -aG wheel tech
-a - Add a secondary group
-G - Add a supplementary group
wheel is a special user used to control SUDO fun.
Which of the following is the purpose of the vmlinux file on aLinux system?
A. To prevent a Linux kernel panic.
B. To start a Linux virtual machine.
C. To provide the executable kernel for the system.
D. To enable resource access to the network.
C. To provide the executable kernel for the system.
It is the uncompressed kernel in ELF format, used primarily for debug. Misleading, as it has nothing to do with virtual machines.
Ann, a junior systems administrator, is required to add a line to the /etc/yum.conf file. However, she receives the following error message when she tries to add the line:
root@comptia: echo “line” > /etc/yum.conf
-suL /etc/yum.conf: Operation not permitted
Which of the following commands should Ann execute to write content to /etc/yum?
A. chmod 755 /etc/yum.conf
B. setfacl -m m:rw /etc/yum.conf
C. chatter -I /etc/yum.conf
D. setenforce 0
A. chmod 755 /etc/yum.conf
Select the only “chmod” answer for this permissions questions.
A Linux administrator needs to take stock of USB devices attached to the system. Which of the following commands would be BEST to complete this task?
A. lspci
B. lsusb
C. cat /proc/USB
D. modprobe –usb
B. lsusb
Self explanatory.
Given the output below:
lrwxrwxrwx, 1, root, root, MyPhoto.jpg -> /Pictures/photo.jpg
Which of the following commands can be used to remove MyPhoto.jpg from the current directory?
A. unlink ./MyPhoto.jpg B. del Pictures/photo.jpg C. rm -rf ./Pictures D. rm -f MyPhoto.jpg E. ln -rm ./Pictures/photo.jpg
D. rm -f MyPhoto.jpg
the only “rm” deleting MyPhoto.jpg.
Which of the following server roles would assign a host IP address?
A. DHCP
B. NTP
C. DNS
D. SSH
A. DHCP
CCNA overlap!
Which of the following commands would show the default printer on a Linux system?
A. lpr
B. lpq
C. lpsta
D. lspci
B. lpq
“lpq” is a shorter way to isolate “lpoptions printer-info”
A system administrator has set up third-party log aggregation agents across several cloud instances. The ystems administrator wants to create a dashboard of failed SSH attempts and the usernames used.
Which of the following files should be watched by the agents?
A. /vr/log/audit/audit.log
B. /var/log/kern.log
C. /var/log/monitor
D. /etc/rsyslog.conf
D. /etc/rsyslog.conf
rSyslog that we all know and love.
A systems administrator must clean up all application files in the directory /var/log/app. However, the company’s security policy requires the files to be kept on the backup server for one year. The Linux srver has only the tar and bzip2 packages installed.
Which of the following commands will package and compress the files?
A. tar -zcvf applicationfiles.tar.bz2 /var/log/app/*
B. tar -jcvf applicationfiles.tar.bz2 /var/log/app/*
C. tar -cvf applicationfiles.tar.bz2 /var/log/app/*
D. tar -xvf applicationfiles.tar.bz2 /var/log/app/*
C. tar -cvf applicationfiles.tar.bz2 /var/log/app/*
Look for the “-cvf” flags.
c – Creates a new .tar archive file.
v – Verbosely show the .tar file progress.
f – File name type of the archive file.
In order to comply with new security policies, an administrator needs to prevent he SSH server from using insecure algorithms.
Which of the following files should be edited to accomplish this?
A. /etc/ssh/sshd_donfig
B. /etc/ssg/ssh_config
C. ~/.ssh/ssh_config
D. /etc/ssh/known_hosts
A. /etc/ssh/sshd_config
sshd that we all know and love.
Which of the following are init systems used within Linux systems? (Choose THREE correct answers).
A. startd B. systemd C. Upstart D. SysInit E. SysV init
B, C, and E.
B. systemd
C. Upstart
E. SysV init
What information can the lspci command display about the system hardware? (Choose THREE correct snswers).
A. Device IRQ settings B. PCI bus speed C. System battery type D. Device vendor identification E. Ethernet MAC address
A, B, and D.
A. Devie IRQ settings
B. PCI bus speed
D. Device vendor identification