Exam Details

  • Exam Code
    :XK0-005
  • Exam Name
    :CompTIA Linux+
  • Certification
    :CompTIA Certifications
  • Vendor
    :CompTIA
  • Total Questions
    :396 Q&As
  • Last Updated
    :Mar 31, 2025

CompTIA CompTIA Certifications XK0-005 Questions & Answers

  • Question 111:

    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 follow-ing 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 /home/user/script . sh

    D. chmod 0+r /horne/user/script. sh

  • Question 112:

    Which of the following will prevent non-root SSH access to a Linux server?

    A. Creating the /etc/nologin file

    B. Creating the /etc/nologin.allow file containing only a single line root

    C. Creating the /etc/nologin/login.deny file containing a single line +all

    D. Ensuring that /etc/pam.d/sshd includes account sufficient pam_nologin.so

  • Question 113:

    A Linux engineer has been notified about the possible deletion of logs from the file /opt/app/logs. The engineer needs to ensure the log file can only be written into without removing previous entries.

    Which of the following commands would be BEST to use to accomplish this task?

    A. chattr +a /opt/app/logs

    B. chattr +d /opt/app/logs

    C. chattr +i /opt/app/logs

    D. chattr +c /opt/app/logs

  • Question 114:

    A Linux administrator needs to determine whether a hostname is in the DNS. Which of the following would supply the information that is needed?

    A. nslookup

    B. rsyn

    C. netstat

    D. host

  • Question 115:

    What is the main objective when using Application Control?

    A. To filter out specific content.

    B. To assist the firewall blade with handling traffic.

    C. To see what users are doing.

    D. Ensure security and privacy of information.

  • Question 116:

    An administrator attempts to connect to a remote server by running the following command:

    $ nmap 192.168.10.36

    Starting Nmap 7.60 ( https://nmap.org ) at 2022-03-29 20:20 UTC

    Nmap scan report for www1 (192.168.10.36)

    Host is up (0.000091s latency).

    Not shown: 979 closed ports

    PORT STATE SERVICE

    21/tcp open ftp

    22/tcp filtered ssh

    631/tcp open ipp

    Nmap done: 1 IP address (1 host up) scanned in 0.06 seconds

    Which of the following can be said about the remote server?

    A. A firewall is blocking access to the SSH server.

    B. The SSH server is not running on the remote server.

    C. The remote SSH server is using SSH protocol version 1.

    D. The SSH host key on the remote server has expired.

  • Question 117:

    Due to low disk space, a Linux administrator finding and removing all log files that were modified more than 180 days ago. Which of the following commands will accomplish this task?

    A. find /var/log -type d -mtime +180 -print -exec rm {} \;

    B. find /var/log -type f -modified +180 -rm

    C. find /var/log -type f -mtime +180 -exec rm {} \

    D. find /var/log -type c -atime +180 璻emove

  • Question 118:

    A systems administrator notices the process list on a mission-critical server has a large number of processes that are in state "Z" and marked as "defunct." Which of the following should the administrator do in an attempt to safely remove these entries from the process list?

    A. Kill the process with PID 1.

    B. Kill the PID of the processes.

    C. Kill the parent PID of the processes.

    D. Reboot the server.

  • Question 119:

    Users are unable to create new files on the company's FTP server, and an administrator is troubleshooting the issue. The administrator runs the following commands:

    Which of the following is the cause of the issue based on the output above?

    A. The users do not have the correct permissions to create files on the FTP server.

    B. The ftpusers filesystem does not have enough space.

    C. The inodes is at full capacity and would affect file creation for users.

    D. ftpusers is mounted as read only.

  • Question 120:

    An administrator deployed a Linux server that is running a web application on port 6379/tcp.

    SELinux is in enforcing mode based on organization policies.

    The port is open on the firewall.

    Users who are trying to connect to a local instance of the web application receive Error 13, Permission denied.

    The administrator ran some commands that resulted in the following output:

    Which of the following commands should be used to resolve the issue?

    A. semanage port -d -t http_port_t -p tcp 6379

    B. semanage port -a -t http_port_t -p tcp 6379

    C. semanage port -a http_port_t -p top 6379

    D. semanage port -l -t http_port_tcp 6379

Tips on How to Prepare for the Exams

Nowadays, the certification exams become more and more important and required by more and more enterprises when applying for a job. But how to prepare for the exam effectively? How to prepare for the exam in a short time with less efforts? How to get a ideal result and how to find the most reliable resources? Here on Vcedump.com, you will find all the answers. Vcedump.com provide not only CompTIA exam questions, answers and explanations but also complete assistance on your exam preparation and certification application. If you are confused on your XK0-005 exam preparations and CompTIA certification application, do not hesitate to visit our Vcedump.com to find your solutions here.