Last Updated on July 17, 2021 by Admin 1

XK0-004 : CompTIA Linux+ : Part 08

  1. A systems administrator installs a simple package, but the Linux system returns the following error: rpmdb open fails. To verify if there is a problem in the RPM database, the systems administrator runs the following command:

    XK0-004 Part 08 Q01 049
    XK0-004 Part 08 Q01 049

    Which of the following commands should the systems administrator run NEXT to resolve this issue?

    • cd/var/lib/rpm; rpm –rebuilddb ; rm -f _db*; yum clean all
    • cd/var/lib/rpm; rpm -qd; rpm –rebuilddb; yum clean all
    • cd/var/lib/rpm; rpm -qa; rm -f _db*; yum clean all
    • cd/var/lib/rpm; rm -f _db*; rpm –rebuilddb; yum clean all
  2. Joe, a user, reports that he is no longer able to write files to his home directory. Upon inspection, the Linux administrator discovers that attempting to create a new file gives the following error: No space left on device. However, the disk and partition are not full. Which of the following commands would be BEST for the administrator to use to continue troubleshooting this problem?

    • rm -Rf ~/.*
    • fsck -y /dev/sda1
    • df -i
    • fdisk /dev/sda
  3. A Linux administrator is adding a static IP address to a network interface on a Linux system. The administrator modifies the ifcfg- eth0 configuration file with the following settings:

    XK0-004 Part 08 Q03 050
    XK0-004 Part 08 Q03 050

    After the administrator restarts the Linux server, the system is not connected to the network. Which of the following configuration settings needs to be changed?

    • Set BOOTPROTO to BOOTP and USERCTL to yes.
    • Set BOOTPROTO to NONE and ONBOOT to yes.
    • Set USERCTL to yes and ONBOOT to no.
    • Set NETMASK to 255.255.0.0 and ONBOOT to yes.
  4. A company wants to provide internal identity verification services for networked devices. Which of the following servers should be installed?

    • SHH
    • VPN
    • CA
    • DHCP
    • DNS
  5. An administrator notices a directory on a web server named /var/www/html/old_reports that should no longer be accessible on the web. Which of the following commands will accomplish this task?

    • chmod 000 /var/www/html/old_reports
    • chgrp root /var/www/html/old_reports
    • chown apache /var/www/html/old_reports
    • setenforce apache /var/www/html/old_reports
  6. A Linux administrator wants to configure log messages of critical or higher severity levels from the cron utility to be logged to the console. Which of the following will accomplish this objective?

    • Edit the /etc/logrotate.d/cron file to include the line cron.emerg.* /dev/console
    • Edit the /etc/rsyslog.conf file to include the line cron.emerg.* /dev/console
    • Edit the /etc/logrotate.conf file to include the line cron.emerg.* /dev/console
    • Edit the /etc/rsyslog.d/conf file to include the line cron.emerg.* /dev/console
  7. A file server is sharing a directory called /share between team members inside a company. The fileshare needs to be moved from serverA to /newshare located on serverB with all permissions and attributes preserved. Which of the following commands would BEST achieve this task?

    • rsync -aHAX /share/* serverB:/newshare
    • dd if=/share/* of=serverB:/newshare
    • tar -cvf /share/* serverB:/newshare
    • mirrorlv /share/* serverB:/newshare
  8. An administrator needs to look at a log for an application on a systemd-based system. There is no log for this application in /var/log. Which of the following is another way to view the application log on this system?

    • tail -f /var/log/secure
    • journalctl –u application
    • systemctl application.service
    • watch /var/lib/application/
  9. Which of the following is true about Type 2 hypervisors?

    • Type 2 hypervisors run on top of another general purpose OS.
    • Type 2 hypervisors are often called bare-metal or native hypervisors.
    • Type 2 hypervisors offer a performance increase to the guests in comparison to a Type 1 hypervisor.
    • Only Type 2 hypervisors allow direct access to CPU virtualization features.
  10. A security administrator wants to display a warning banner before a user logs in. Which of the following files must be edited to make this happen?

    • /etc/services
    • /etc/issue
    • /etc/hosts
    • /etc/motd
  11. Using which of the following control mode commands is the correct way to substitute all occurrences of /dev/sdc with /dev/sdd while editing a file in vi?

    • :s//dev/sdc//dev/sdd
    • :s/\/dev\/sdc/\/dev\/sdd/g
    • :s/\/dev\/sdc/\/dev\/sdd
    • :%s/\/dev\/sdc/\/dev\/sdd
  12. A user needs to modify the IP address of a laptop. Which of the following files can be used to configure the network interface named eth0?

    • /etc/sysconfig/network/interfaces.cnf
    • /system/config/interfaces
    • /etc/sysconfig/network-scripts/ifcfg-eth0
    • /system/networking/ifconfig
    • /etc/interfaces/eth0.conf
  13. A user wants to use terminal services from a Windows workstation to manage a Linux server. Which of the following should be installed on the Linux server to enable this functionality?

    • VNC
    • rdesktop
    • SPICE
    • XRDP
  14. On a UEFI-based system, which of the following invokes GRUB2 from the EFI command prompt?

    • boot//EFI/grub2.efi
    • EFI/grub2.efi
    • /boot/EFI/grub2.efi
    • /grub2.efi
  15. A systems administrator notices a large number of autoloaded device modules are no longer needed and decides to do a cleanup of them. Which of the following commands will accomplish this task?

    • rmmod -c
    • depmod -r
    • insmod -c
    • modprobe -r
  16. A Linux administrator looks at the /etc/timezone file and determines the need to change the time zone from California to New York temporarily. Which of the following commands will accomplish this?

    • sed -f TZ=America/New_York
    • cat TZ=America/New_York
    • export TZ=America/New_York
    • printf TZ=America/New_York
  17. A user has been locked out of an account due to too many failed password attempts. Which of the following commands will unlock the user’s account?

    • pam_tally2 –user=user –reset
    • passwd -u user -G root
    • usermod -u user -G root
    • chage -1 user=user –reset
  18. A systems administrator receives a report that the web server is not running after a planned system reboot. After starting the web server manually, which of the following commands should the administrator issue to ensure the web server starts at boot time?

    • systemctl service on
    • systemctl enable <name>.service
    • systemctl service enable
    • systemctl on <name>.service
  19. An administrator is reviewing updates in the master online Git repository and notices a file named .htaccess. The file contains passwords and should only be in the administrator’s local repository, not the online one. Which of the following would prevent this file from appearing online in the future?

    • git commit -m “File Update” -x .htaccess
    • sed -i ‘s/#Preserve Hidden=True/Preserve Hidden=True/g’ .git/config
    • chown nobody:nodoby .htaccess
    • echo “.htaccess” >> .gitignore
  20. A technician wants to secure a sensitive workstation by ensuring network traffic is kept within the local subnet. To accomplish this task, the technician executes the following command:

    echo 0 > /proc/sys/net/ipv4/ip_default_ttl

    Which of the following commands can the technician use to confirm the expected results? (Choose two.)

    • tcpdump
    • traceroute
    • route
    • iperf
    • ip
    • arp