ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 173 - XK0-005 discussion

Report
Export

User1 is a member of the accounting group. Members of this group need to be able to execute but not make changes to a script maintained by User2. The script should not be accessible to other users or groups. Which of the following will give proper access to the script?

A.
chown user2:accounting script.shchmod 750 script.sh
Answers
A.
chown user2:accounting script.shchmod 750 script.sh
B.
chown user1:accounting script.shchmod 777 script.sh
Answers
B.
chown user1:accounting script.shchmod 777 script.sh
C.
chown accounting:user1 script.shchmod 057 script.sh
Answers
C.
chown accounting:user1 script.shchmod 057 script.sh
D.
chown user2:accounting script.shchmod u+x script.sh
Answers
D.
chown user2:accounting script.shchmod u+x script.sh
Suggested answer: A

Explanation:

The commands that will give proper access to the script are:

chown user2:accounting script.sh: This command will change the ownership of the script to user2 as the owner and accounting as the group. The chown command is a tool for changing the owner and group of files and directories on Linux systems. The user2:accounting is the user and group name that the command should assign to the script. The script.sh is the name of the script that the command should modify. The command chown user2:accounting script.sh will ensure that user2 is the owner of the script and accounting is the group of the script, which will allow user2 to maintain the script and the accounting group to access the script.

chmod 750 script.sh: This command will change the permissions of the script to 750, which means read, write, and execute for the owner; read and execute for the group; and no access for others.

The chmod command is a tool for changing the permissions of files and directories on Linux systems.

The permissions are represented by three digits in octal notation, where each digit corresponds to the owner, group, and others. Each digit can have a value from 0 to 7, where each value represents a combination of read, write, and execute permissions. The 750 is the permission value that the command should assign to the script. The script.sh is the name of the script that the command should modify. The command chmod 750 script.sh will ensure that only the owner and the group can execute the script, but not make changes to it, and that the script is not accessible to other users or groups.

The commands that will give proper access to the script are chown user2:accounting script.sh and chmod 750 script.sh. This is the correct answer to the question. The other options are incorrect because they either do not give proper access to the script (chown user1:accounting script.sh or chown accounting:user1 script.sh) or do not change the permissions of the script (chmod 777 script.sh or chmod u+x script.sh). Reference: CompTIA Linux+ (XK0-005) Certification Study Guide, Chapter 11: Managing File Permissions and Ownership, pages 346-348.

asked 02/10/2024
Sergio Escobar
34 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first