Winter Sale Special Limited Time 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: v4s65

XK0-005 Exam Dumps - CompTIA Linux+ Exam

Go to page:
Question # 41

A systems administrator is creating new user accounts on several Linux machines and wants to automate the process from a Linux system used for operations. In this operations system, the list of servers is located in the /home/user/serverslist file and the list of user accounts is located in the /home/user/userslist file. Which of the following scripts will help accomplish this task?

A.

bash

for server in $(cat /home/user/serverslist)

do

for user in $(cat /home/user/userslist)

do

sudo useradd $user

done

done

B.

bash

for server in $(cat /home/user/serverslist)

do

ssh -i user@$server "for user in $(cat /home/user/userslist)

do

sudo useradd $user

done; exit"

done

C.

bash

for server in $(cat /home/user/serverslist)

do

scp /home/user/userslist user@$server:/tmp

ssh -i user@$server "for user in $(cat /tmp/userslist)

do

sudo useradd $user

done; exit"

done

D.

bash

ssh user@$(cat /home/user/serverslist) "sudo useradd $(cat /home/user/userslist); exit"

Full Access
Question # 42

Which of the following commands will display the operating system?

A.

uname -n

B.

uname -s

C.

uname -o

D.

uname -m

Full Access
Question # 43

A network administrator issues the dig www.foo.com 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

Full Access
Question # 44

A Linux administrator generated a list of users who have root-level command-line access to the Linux server to meet an audit requirement. The administrator analyzes the following /etc/passwd and /etc/sudoers files:

$ cat /etc/passwd

root:x: 0:0: :/home/root: /bin/bash

lee: x: 500: 500: :/home/lee:/bin/tcsh

mallory:x: 501:501: :/root:/bin/bash

eve:x: 502: 502: /home/eve:/bin/nologin

carl:x:0:503: :/home/carl:/bin/sh

bob:x: 504: 504: : /home/bob:/bin/ksh

alice:x: 505:505: :/home/alice:/bin/rsh

$ cat /etc/sudoers

Cmnd_Alias SHELLS = /bin/tcsh, /bin/sh, /bin/bash

Cmnd_Alias SYSADMIN = /usr/sbin/tcpdump

ALL = (ALL) ALL

ALL = NOPASSWD: SYSADMIN

Which of the following users, in addition to the root user, should be listed in the audit report as having root-level command-line access? (Select two).

A.

Carl

B.

Lee

C.

Mallory

D.

Eve

E.

Bob

F.

Alice

Full Access
Question # 45

Application code is stored in Git. Due to security concerns, the DevOps engineer does not want to keep a sensitive configuration file, app . conf, in the

repository. Which of the following should the engineer do to prevent the file from being uploaded to the repository?

A.

Run git exclude app. conf.

B.

Run git stash app. conf.

C.

Add app . conf to . exclude.

D.

Add app . conf to . gitignore.

Full Access
Question # 46

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

Full Access
Question # 47

A senior administrator has placed a private key for user admin in your home directory.

The server you need to remotely access is server1 and SSH is listening on port 2222.

INSTRUCTIONS

Part 1

Review the command output and build the correct command to place the private key

into your SSH folder.

Part 2

Review the command output and build the correct command to set the file

permissions.

Part 3

Review the command output and build the correct command to set the correct

ownership.

In each part, click on objects to build a complete command. Command objects may

be used more than once, but not all will be used. Use _ as the spacebar. Click the

arrow to remove any unwanted objects from your command.

Part 4

Select the proper file to edit for remote server access. Then, build the correct

configuration output based on the server name, ports, and files.

Full Access
Question # 48

A Linux engineer needs to create a custom script, cleanup.sh, to run at boot as part of the system services. Which of the following processes would accomplish this task?

A.

Create a unit file in the /etc/default/ directory.

systemct1 enable cleanup

systemct1 is-enabled cleanup

B.

Create a unit file in the /etc/ske1/ directory.

systemct1 enable cleanup

systemct1 is-enabled cleanup

C.

Create a unit file in the /etc/systemd/system/ directory.

systemct1 enable cleanup

systemct1 is-enabled cleanup

D.

Create a unit file in the /etc/sysctl.d/ directory.

systemct1 enable cleanup

systemct1 is-enabled cleanup

Full Access
Go to page: