XK0-004
Free trial
Verified
Question 1
Which of the following would be the BEST solution for a systems administrator to access the graphical user environment of a Linux machine remotely?
- A: VNC
- B: KDE
- C: X11
- D: RPC
Question 2
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
Question 3
An administrator notices that a long-running script, /home/user/script.sh, is taking up a large number of system resources. The administrator does not know the script's function. Which of the following commands should the administrator use to minimize the script's impact on system resources?
- A: renice
- B: kill
- C: bg
- D: nohup
Question 4
An administrator needs to deploy 100 identical CentOS workstations via PXE boot. Which of the following should the administrator use to minimize the amount of interaction with the consoles needed?
- A: Kickstart script
- B: Ghost image on a distribution server
- C: Hard disk duplicator
- D: Hard disk duplicator
- E: Ubiquity script
Question 5
A user, jsmith, needs access to database files located on a server. Which of the following will add jsmith to the dba group and preserve existing group memberships?
- A: usermod ג€"a ג€"G dba jsmith
- B: usermod ג€"g dba jsmith
- C: useradd ג€"g dba jsmith
- D: groupmod dba ג€"u jsmith
Question 6
A Linux administrator installed a new network adapter and temporarily disabled the network service from starting on boot. The partial output of chkconfig is as follows:
Which of the following commands BEST describes how the administrator should re-enable the network service?
- A: chkconfig --level 0 network on
- B: chkconfig --level 0-6 network on
- C: chkconfig --level 6 network on
- D: chkconfig --level 12 network on
- E: chkconfig --level 345 network on
Question 7
An engineer is working on a production application deployment that requires changing a web application property file called server.property that is managed by the Git version control system. A cloned copy of the remote repository in which the server.property file exists is on the local desktop computer. The engineer makes appropriate changes to the files, saves it as server.property, and executes git commit "m changed the property file` server.property. Which of the following commands did the engineer fail to perform?
- A: git init server.property
- B: git merge server.property
- C: git add server.property
- D: git push server.property
Question 8
A Linux administrator retrieved a repository of files from a Git server using git clone. The administrator wants to see if a configuration file was added to the repository. Which of the following Git arguments should be used to see the recent modifications?
- A: fetch
- B: log
- C: init
- D: pull
Question 9
A systems administrator is unable to reach other devices on the network and the Internet. The server is configured with the IP address 192.169.1.50/24 on eth0.
The server's router is 192.168.1.1. The administrator reviews the output of route `"n:
Which of the following commands should the administrator run to correct the issue?
- A: route del default gw 192.168.2.1 eth0; route add default gw 192.168.1.1 eth0
- B: route add ג€"net 192.168.10.0 netmask 255.255.255.0 gw 192.168.2.1 eth0
- C: route add 192.168.1.1 default 192.168.1.50 eth0
- D: route host gw 192.168.1.1 eth0
Question 10
A junior Linux administrator needs to access production servers using a secure SSH protocol. Which of the following files should contain the public key to gain remote access to the server?
- A: ~/ssh/authorized-keys
- B: /etc/authorized_keys
- C: /etc/sshd/ssh.conf
- D: ~/.ssh/authorized_keys
Question 11
An administrator needs to see the type of CPU that a server is running. Which of the following files contains this information?
- A: /proc/cpuinfo
- B: /etc/devices/info.conf
- C: /dev/proc/cpu
- D: /sys/dev/cpuinfo
Question 12
A junior systems administrator is creating a cron job. The cron job requirements are as follows:
✑ Run the hello.sh script every hour (24 times in one day).
✑ Run it on Monday only.
Given this scenario, which of the following crontab options should be configured to meet these requirements?
- A: 0 *** 1 hello.sh
- B: 0 24 ** Monday hello.sh
- C: 24 *** Monday hello.sh
- D: 1 *** 0 hello.sh
Question 13
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 > test.txt
- B: ls ג€"lha /opt < test.txt
- C: ls ג€"lha /opt >> test.txt
- D: ls ג€"lha /opt << test.txt
Question 14
A Linux systems administrator is setting up SSH access with PKI for several using their newly created RSA keys. Which of the following MOST securely achieves this task?
- A: Use curl to copy each user's public key file to the respective system
- B: Use cp to copy each user's public key file to the respective system
- C: Use ssh-copy-id to copy each user's public key file to the respective system
- D: Use ssh-copy-id to copy each user's private key file to the respective system
Question 15
The development team has automated their software build process so each time a change is submitted to the source code repository, a new software build is compiled. They are requesting that the Linux operations team look into automating the deployment of the software build into the test environment. Which of the following is the benefit to the development team for implementing deployment automation?
- A: To ensure the build commits are also deployed to the test environment
- B: To enable notifications when builds are deployed to the test environment
- C: To ensure software builds in test are not accidentally deployed to production
- D: To streamline the deployment process for deploying builds into test environments
Question 16
A Linux administrator needs to schedule a cron job to run at 1:15 p.m. every Friday to report the amount of free disk space on the system and to send the output to a file named freespace. Which of the following would meet this requirement?
- A: 13 15 * * 5 df > /freespace
- B: 15 13 * * 5 df > /freespace
- C: 15 1 * * 6 df > /freespace
- D: 15 13 6 * * df > /freespace
Question 17
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.)
- A: tcpdump
- B: traceroute
- C: route
- D: iperf
- E: ip
- F: arp
Question 18
A junior Linux administrator needs to ensure a service will start on system boot. Which of the following commands should be used to accomplish this task?
- A: chkconfig <service> on
- B: systemctl <service> bootup
- C: service <service> enable
- D: crontab install <service>
Question 19
SIMULATION -
Find the file named core and remove it from the system.
INSTRUCTIONS -
Type help to display a list of available commands.
If at any time you would like to bring back the initial state of the simulation, please click the Reset All button.
Question 20
DRAG DROP -
As a Systems Administrator, to reduce disk space, you were tasked to create a shell script that does the following:
Add relevant content to /tmp/script.sh, so that it finds and compresses rotated files in /var/log without recursion.
INSTRUCTIONS -
Fill the blanks to build a script that performs the actual compression of rotated log files.
If at any time you would like to bring back the initial state of the simulation, please click the Reset All button.
Select and Place:
Question 21
A systems administrator uses a remote execution engine to iterate through each IP address in a network and run a script on remote hosts. The script captures the remote system's hostname, IP address, OS distribution, and system uptime. The output of the script gets saved to the administrator's local workstation for future processing.
Which of the following is this an example of?
- A: Performance monitoring
- B: Inventory
- C: Agentless
- D: Infrastructure as code
- E: Build automation
Question 22
A Linux administrator has installed a web application firewall in front of a web server running on HTTP port 8080 and successfully started the HTTP server.
However, after opening the application URL in an Internet browser, the administrator discovered that the application does not work. The administrator performed the following diagnostic steps:
Output of sysctl -a command:
Output of iptables -L command:
Output of netstat `"nltop | grep "8080":
Which of the following is the NEXT step the administrator should perform to permanently fix the issue at the kernel level?
- A: sysctl -w net.ipv4.ip_forward=1 then run sysctl -w /etc/sysctl.conf to enable the change
- B: Edit /etc/sysctl.conf file and add net.ipv4.ip_forward = 1 then run sysctl -p /etc/sysctl.conf to enable the change
- C: Add iptables rule iptables -A INPUT -m state --state NEW -p tcp --dport 8080 -j then restart httpd daemon
- D: Add iptables rule iptables -A FORWARD-m state --state NEW -p tcp --dport 8080 ג€"j ACCEPT then restart httpd daemon
Question 23
A member of the production group issues the following command: echo "Monday through Friday" > /production_docs/days
The command fails to execute, so the user obtains the following output: drwxr--r-- root production 0 Jun 16 2018 production
-rw-r--r-- production production 4096 Jun 14 2018 days
Which of the following commands should the user execute to BEST fix the issue?
- A: chmod g+w production to change the permissions on the days file
- B: chgrp root production_docs/days to change the group ownership of the production_docs/days file
- C: chmod g+S production to set the GUID on the production_docs directory
- D: chown production to change the ownership of the production_docs directory
Question 24
A Linux administrator needs to remotely update the contents of the www.comptia.org/contacts URL.
Which of the following commands would allow the administrator to download the current contents of the URL before updating?
- A: curl www.comptia.org/contacts
- B: dig www.comptia.org/contacts
- C: apt-get www.comptia.org/contacts
- D: yum list www.comptia.org/contacts
Question 25
A user wants to list the lines of a log, adding a correlative number at the beginning of each line separated by a set of dashes from the actual message. Which of the following scripts will complete this task?
A.
B.
C.
D.
Free preview mode
Enjoy the free questions and consider upgrading to gain full access!