Linux+ Cert Questions

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

A network administrator issues the dig www.comptia.org command and receives an NXDOMAIN response. Which of the following files should the administrator check first? A. /etc/resolv.conf B. /etc/hosts C. /etc/sysconfig/network-scripts D. /etc/nsswitch.conf

A. /etc/resolv.conf

A user created the following script file: # ! /bin/bash # FILENAME: /home/user/script.sh echo "hello world" exit 1 However, when the user tried to run the script file using the command ~/script.sh, an error returned indicating permission was denied. Which of the following should the user execute in order for the script to run properly? A. Chmod u+x /home/user/script.sh B. Chmod 600 /home/user/script.sh C. Chmod 007 /home/user/script.sh D. Chmod o+r /home/user/script.sh

A. Chmod u+x /home/user/script.sh

Which of the following technologies can be used as a central repository of Linux users and groups? A. LDAP B. MFA C. SSO D. PAM

A. LDAP

Which of the following specifications is used to perform disk encryption in a Linux system? A. LUKS B. TLS C. SSL D. NFS

A. LUKS (Linux Unified Key Setup)

The applications team is reporting issues when trying to access the web service hosted in a Linux system. The Linux systems administrator is reviewing the following outputs: Output1: * httpd.service = The Apache HTTPD Server Loaded: loaded (/usr/lib/systemd/system/httpd/service; disabled; vendor preset: disabled) Active: inactive (dead) Docs: man : httpd(8) man : apachectl (8) Output 2: 16:51:16 up 28 min, 1 user, load average: 0.00, 0.00. 0.07 Which of the following statements best describes the root cause? (select two) A. The httpd service is currently started. B. The httpd service is enabled to auto start at boot time, but it failed to start. C. The httpd service was manually stopped. D. The httpd service is not enabled to auto start at boot time. E. The httpd service runs without problems. F. The httpd service did not start during the last server reboot.

A. The httpd service is currently started. C. The httpd service was manually stopped. D. The httpd service is not enabled to auto start at boot time.

Users are experiencing high latency when accessing a web application served by a Linux machine. A systems administrator checks the network interface counters and sees the following: #ip -s link list dev enp0s25 2: enp0s25: <BROADCAST, MULTICAST, LOWER UP, UP> mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000 link/ether ac:12:34:56:78: cd brd ff:ff:ff:ff:ff:ff RX: bytes packets errors dropped missed mcast 2011664755 3579033 2394390 508 0 0 TX: bytes packets errors dropped carrier collsns 309541780 1705408 0 0 12340 0 Which of the following is the most probable cause of the observed latency? A. The network interface is disconnected. B. A connection problem exists on the network interface. C. No IP address is assigned to the interface. D. The gateway is unreachable

A. The network interface is disconnected.

A systems administrator is gathering information about a file type and the contents of a file. Which of the following commands should the administrator use to accomplish this task? A. file filename B. touch filename C. grep filename D. lsof filename

A. file filename

An administrator needs to get network information from a group of statically assigned workstations before they are reconnected to the network. Which of the following should the administrator use to obtain this information? A. ip show B. ifcfg-a C. ifcfg -s D. ifname -s

A. ip show

Due to performance issues on a server, a Linux administrator needs to terminate an unresponsive process. Which of the following commands should the administrator use to terminate the process immediately without waiting for a graceful shutdown? A. kill -SIGKILL 5545 B. kill -SIGTERM 5545 C. kill -SIGHUP 5545 D. kill - SIGINT 5545

A. kill -SIGKILL 5545

A Linux administrator was asked to run a container with the httpd server inside. This container should be exposed at port 443 of a Linux host machine while it internally listens on port 8443. Which of the following commands will accomplish this task? A. podman run -d -p 443:8443 httpd B. podman run -d -p 8443:443 httpd C. podman run -d -e 443:8443 httpd D. podman exec -p 8443:443 httpd

A. podman run -d -p 443:8443 httpd

An administrator accidentally deleted the /boot/vmlinuz file and must resolve the issue before the server is rebooted. Which of the following commands should the administrator use to identify the correct version of this file? A. rpm -qa | grep kernel; uname -a B. yum -y update; shutdown -r now C. cat /etc/centos-release; rpm -Uvh --nodeps D. telinit 1; restorecon -Rv /boot

A. rpm -qa | grep kernel; uname -a

After starting an Apache web server, the administrator receives the following error: Apr 23 11:49:06 localhost.localdomain httpd [4618]: (98) Address already in use: AH00072: make_sock: could not bind to address [::]:80 Which of the following commands should the administrator use to further troubleshoot this issue? A. ss B. ip C. dig D. nc

A. ss

Ann, a security administrator, is performing home directory audits on a Linux server. Ann issues the su Joe command and then issues the ls command. The output displays files that reside in Ann's home directory instead of Joe's. Which of the following represents the command Ann should have issued in order to list Joe's files? A. su - Joe B. sudo Joe C. visudo Joe D. pxexec Joe

A. su - Joe

Which of the following commands should a technician use to create an administrative account for the username Joe? A. sudo useradd -G wheel joe B. sudo useradd joe; sudo passwd -1 joe C. sudo useradd joe; sudo cat key.pem>~/.ssh/authorized_keys D. sudo useradd joe; groupadd admin joe

A. sudo useradd -G wheel joe

A systems administrator needs to clone the partition /dev/sdc1 to /dev/sdd1. Which of the following commands will accomplish this task? A. tar -cvzf /dev/sdd1 /dev/sdc1 B. rsync /dev/sdc1 /dev/sdd1 C. dd if=/dev/sdc1 of=/dev/sdd1 D. scp /dev/sdc1 /dev/sdd1

A. tar -cvzf /dev/sdd1 /dev/sdc1 B. rsync /dev/sdc1 /dev/sdd1 D. scp /dev/sdc1 /dev/sdd1

A systems administrator checked out the code from the repository, created a new branch, made changes to the code, and then updated the main branch. The systems administrator wants to ensure that the Terraform state files do not appear in the main branch. Which of the following should the administrator use to meet this requirement? A. clone B. gitignore C. get

B. Gitignore

A systems administrator needs to list the contents of archive.tar.xz. Which of the following commands will list the files? A. Tar ddf archive.tar.xz B. Tar tJf archive.tar.xz C. Tar xzf archive.tar.xz D. Tar jvf archive.tar.xz

B. Tar tJf archive.tar.xz

A systems administrator intends to use a UUID to mount a new partition permanently on a Linux system. Which of the following commands can the administrator run to obtain information about the UUIDS of all disks attached to a Linux system? A. fcstat B. blkid C. dmsetup D. lsscsi

B. blkid

Following the migration from a disaster recovery site, a systems administrator wants a server to require a user to change credentials at initial login. Which of the following commands should be used to ensure the aging attribute? A. chage -d 2 user B. chage -d 0 user C. chage -E 0 user D. chage -d 1 user

B. chage -d 0 user

A new file was added to a main Git repository. An administrator wants to synchronize a local copy with the contents of the main repository. Which of the following commands should the administrator use for this task? A. git reflog B. git pull C. git status D. git push

B. git pull

A Linux administrator needs to analyze a failing application that is running inside a container. Which of the following commands allows the Linux administrator to enter the running container and analyze the logs that are stored inside? A. docker run -ti app /bin/sh B. podman exec -ti app /bin/sh C. podman run -d app /bin/bash D. docker exec -d app /bin/bash

B. podman exec -ti app /bin/sh

A user is unable to remotely log on to a server using the server name server1 and port 22. The Linux engineer troubleshoots the issue and gathers the following information: nslookup server1 Server: 123.1.2.4 Address: 123.1.2.4#53 Name: server1 Address: 123.1.2.3 #systemctl status sshd sshd.service - Openssh sshd daemon Loaded: loaded (usr/lib/systemd/system/sshd.service; enabled; vendor preset: disabled) Active: active (running) since Thu 2021-09-09 12:44:49 CDT; 6 days ago Main PID: 1900 (sshd) CGroup: /system.slice/sshd.service -1900 /usr/share/sbin/sshd -D #netstat -anp | grep sshd tcp 0 0 123.1.2.3:2222 0.0.0.0:* LISTEN 2701/sshd Which of the following is most likely causing the issue? A. server1 is not in the DNS. B. sshd is running on a non-standard port. C. sshd is not an active service. D. server1 is using an incorrect IP address.

B. sshd is running on a non-standard port.

A systems administrator needs to reconfigure a Linux server to allow persistent IPv4 packet forwarding. Which of the following commands is the correct way to accomplish this task? A. echo 1 > /proc/sys/net/ipv4/ipv_forward B. sysctl -w net.ipv4.ip_forward=1 C. firewall-cmd --enable ipv4_forwarding D. systemctl start ipv4_forwarding

B. sysctl -w net.ipv4.ip_forward=1

Which of the following would significantly help reduce data loss if more than one drive fails at the same time? A. Server clustering B. Load balancing C. RAID D. VDI

C. RAID (Redundant Array of Independent Disks)

A Linux administrator would like to use systemd to schedule a job to run every two hours. The administrator creates timer and service definitions and restarts the server to load these new configurations. After the restart, the administrator checks the log file and notices that the job is only running daily. Which of the following is MOST likely causing the issue? A. The checkdiskspace.service is not running. B. The checkdiskspace.service needs to be enabled. C. The OnCalendar schedule is incorrect in the timer definition. D. The system-daemon services need to be reloaded.

C. The OnCalendar schedule is incorrect in the timer definition

A Linux administrator provisioned a new web server with custom administrative permissions for certain users. The administrator receives a report that user1 is unable to restart the Apache web service on the server. The administrator review the following output: [ root@server ] # id user1 UID=1011 (user1) gid=1011 (USER1) groups=1011 (user1),101(www-data),1120 (webadmin) [ root@server ] # cat /etc/sudoers.d/custom.conf User1 ALL=/usr/sbin/systemctl start httpd, /usr/sbin/systemctl stop httpd Webadmin ALL=NOPASSWD: /etc/init.d.httpd restart, /sbin/service httpd restart, /usr/sbin/apache2ctl restart # %wheel ALL=(ALL) NOPASSWD: ALL most likely resolve the issue while maintaining a least privilege security model? A. User1 should be added to the wheel group to manage the service. B. User1 should have "NOPASSWD:"after the "ALL=" in the custom.conf. C. The wheel line in the custom.conf file should be uncommented. D. Webadm

C. The wheel line in the custom.conf file should be uncommented.

A systems administrator wants to check for running containers. Which of the following commands can be used to show this information? A. docker pull B. docker stats C. docker ps D. docker list

C. docker ps

A developer needs to launch an Nginx image container, name it web001, and expose port 8080 externally while mapping to port 80 inside the container. Which of the following commands will accomplish this task? A. docker exec -it -p 8080:80 --name Web001 nginx B. docker load -it =p 8080:80 --name Web001 nginx C. docker run -it -p 8080:80 --name Web001 nginx D. docker pull -it -p 8080:80 --name Web001 nginx

C. docker run -it -p 8080:80 --name Web001 nginx

A systems administrator wants to permit access temporarily to an application running on port 1234/TCP on a Linux server. Which of the following commands will permit this traffic? A. firewall - cmd --new-service=1234/tcp B. firewall - cmd --service=1234 --protocol=tcp C. firewall - cmd --add-port=1234/tcp D. firewall - cmd --add-whitelist-uid=1234

C. firewall - cmd --add-port=1234/tcp tool is:

A systems administrator created a web server for the company and is required to add a tag for the API so end users can connect. Which of the following would the administrator do to complete this requirement? A. hostnamectl status --no-ask-password B. hostnamectl set-hostname "$(perl -le "print" "A" x 86)" C. hostnamectl set-hostname Comptia-WebNode -H [email protected] D. hostnamectl set-hostname Comptia-WebNode --transient

C. hostnamectl set-hostname Comptia-WebNode -H [email protected]

A systems administrator wants to back up the directory /data and all its contents to /backup/data on a remote server named remote. Which of the following commands will achieve the desired effect? A. scp -p /data remote:/backup/data B. ssh -i /remote:/backup/ /data C. rsync -a /data remote:/backup/ D. cp -r /data /remote/backup/

C. rsync -a /data remote:/backup/

A cloud engineer needs to change the secure remote login port from 22 to 49000. Which of the following files should the engineer modify to change the port number to the desired value? A. /etc/host.conf B. /etc/hostname C. /etc/services D. /etc/ssh/sshd_config

D. /etc/ssh/sshd_config

An engineer needs to insert a character at the end of the current line in the vi text editor. Which of the following will allow the engineer to complete this task? A. p B. r C. bb D. A E. i

D. A

A DevOps engineer wants to allow the same Kubernetes container configurations to be deployed in development, testing, and production environments. A key requirement is that the containers should be configured so that developers do not have to statically configure custom, environment-specific locations. Which of the following should the engineer use to meet this requirement? A. Custom scheduler B. Node affinity C. Overlay network D. Ambassador container

D. Ambassador container

A Linux administrator attempts to log in to a server over SSH as root, and receives the following error message: Permission denied, please try again. The administrator is able to log in to the console of the server directly with root and has confirmed the password is correct. The administrator reviews the configuration of the SSH service and gets the following output: Port 22 PermitRootLogin prohibit-password PasswordAuthentication yes. PermitEmptyPassword no Use PAM no MaxSessions 1 MaxAuthTries 3 Based on the above output, which of the following will most likely allow the administrator to log in over SSH to the server? A. Log out other user sessions because only one is allowed at a time. B. Enable PAM and configure the SSH module. C. Modify the SSH port to use 2222. D. Use a key to log in as root over SSH.

D. Use a key to log in as root over SSH.

An administrator needs to make some changes in the IaC declaration templates. Which of the following commands would maintain version control? A. git clone https://github.com/comptia/linux+-.git git push origin B. git clone https://qithub.com/comptia/linux+-.git git fetch New-Branch C. git clone https://github.com/comptia/linux+-.git git status D. git clone https://github.com/comptia/linuxt+-.git git checkout -b <new-branch>

D. git clone https://github.com/comptia/linuxt+-.git git checkout -b <new-branch>

Developers have requested implementation of a persistent, static route on the application server. Packets sent over the interface eth0 to 10.0.213.5/32 should be routed via 10.0.5.1. Which of the following commands should the administrator run to achieve this goal? A. route -i etho -p add 10.0.213.5 10.0.5.1 B. route modify eth0 +ipv4.routes "10.0.213.5/32 10.0.5.1" C. echo "10.0.213.5 10.0.5.1 eth0" > /proc/net/route D. ip route add 10.0.213.5/32 via 10.0.5.1 dev eth0

D. ip route add 10.0.213.5/32 via 10.0.5.1 dev eth0

A Linux administrator needs to redirect all HTTP traffic temporarily to the new proxy server 192.0.2.25 on port 3128. Which of the following commands will accomplish this task? A. iptables -t nat -D PREROUTING -p tcp --sport 80 -j DNAT - -to-destination 192.0.2.25:3128 B. iptables -t nat -A PREROUTING -p top --dport 81 -j DNAT --to-destination 192.0.2.25:3129 C. iptables -t nat -I PREROUTING -p top --sport 80 -j DNAT --to-destination 192.0.2.25:3129 D. iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination 192.0.2.25:3128

D. iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination 192.0.2.25:3128

A systems administrator is investigating a service that is not starting up. Given the following information: root@localhost ~]# systemctl status network Network.service - LSB: Bring up/down networking Loaded: loaded (/etc/rc.d/init.d/network; bad; vendor preset: disabled) Active: failed (Result: exit-code) since Jan 2022-01-02 22:55:15 CST; Docs: man: systemd-sysv-generator (8) Process: 1083 ExecStart=/etc/rc.d/init.d/network start (code=exited, status=1/FAILURE) Jan 02 22:55:15 localhost.localdomain network [1083]: Bringing up interface enp0s25: Error: Con...n. Jan 02 22:55:15 localhost.localdomain network [1083]: [FAILED] [...] Which of the following systemd commands should the administrator use in order to obtain more details about the failing service? A. systemctl analyze network B. systemctl info network C. sysctl -a network D. journalctl -xu network

D. journalctl -xu network

A new Linux systems administrator just generated a pair of SSH keys that should allow connection to the servers. Which of the following commands can be used to copy a key file to remote servers? (Choose two.) A. wget B. ssh-keygen C. ssh-keyscan D. ssh-copy-id E. ftpd F. scp

D. ssh-copy-id F. scp

A systems administrator is adding a Linux-based server and removing a Windows-based server from a cloud-based environment. The changes need to be validated before they are applied to the cloud-based environment. Which of the following tools should be used to meet this requirement? A. Ansible B. git clone C. git pull D. terraform plan

D. terraform plan

A systems administrator receives reports that several virtual machines in a host are responding slower than expected. Upon further investigation, the administrator obtains the following output from one of the affected systems: 16:00:01 PM CPU %user %nice %system %iowait %steal %idle 16:10:01 PM all 17.58 0.00 9.36 0.00 54.33 18.73 16:20:01 PM all 22.34 0.00 11.75 0.00 48.69 17.22 16:30:01 PM all 25.49 0.00 11.69 0.00 57.85 4.97 16:40:01 PM all 25.49 0.00 11.69 0.00 53.21 9.61 16:50:01 PM all 25.49 0.00 11.69 0.00 56.49 6.33 Which of the following best explains the reported issue? A. The physical host is running out of CPU resources, leading to insufficient CPU time being allocated to virtual machines. B. The physical host has enough CPU cores, leading to users running more processes to compensate for the slower response times. C. The virtual machine has enough CPU cycles, leading to the system use percentage being

The physical host is running out of CPU resources, leading to insufficient CPU time being allocated to virtual machines.

A junior developer is unable to access an application server and receives the following output: [root@server1 ~] # ssh [email protected] [email protected]'s password: Permission denied, please try again. [email protected]'s password: Permission denied, please try again. [email protected]'s password: Account locked due to 4 failed logins Account locked due to 5 failed logins Last login: Mon Apr 22 21:21:06 2021 from 172.16.16.52 The systems administrator investigates the issue and receives the following output: [root@server1 ~] # pam_tally2 --user=dev2 Login Failures Latest failure From Dev2 5 04/22/21 21:22:37 172.16.16.52 Which of the following commands will help unlock the account? A. pam_tally2 --user=dev2 --quiet B. pam_tally2 --user=dev2 C. pam_tally2 --user+dev2 --quiet D. pam_tally2 --user=dev2 --reset

pam_tally2 --user=dev2 --reset

A Linux administrator logs in to a system and identifies that an important backup has been started. The backup process is consuming a considerable amount of CPU time but needs to continue. Which of the following should the administrator use to reduce the impact this process has on other services? renice -n 15 -p <backup pid> B. nice -n 15 -p <backup pid> C. renice -n -15 -p <backup pid> D. nice -n -15 -p <backup pid>

renice -n -15 -p <backup pid>


Kaugnay na mga set ng pag-aaral

Clinical Psychology Exam 2 - Quizzes

View Set

NUR 236 PrepU Chapter 47: Nursing Care of the Child With an Alteration in Immunity/Immunologic Disorder

View Set

Cushings/Addison's Practice Questions

View Set

Chapter 17: Control of Cardiovascular Function Porth 3rd

View Set