exam questions

Exam SK0-005 All Questions

View all questions & answers for the SK0-005 exam

Exam SK0-005 topic 1 question 180 discussion

Actual exam question from CompTIA's SK0-005
Question #: 180
Topic #: 1
[All SK0-005 Questions]

An administrator discovers a Bash script file has the following permissions set in octal notation:

777

Which of the following is the MOST appropriate command to ensure only the root user can modify and execute the script?

  • A. chmod go-rwx
  • B. chmod u=rwx
  • C. chmod u+wx
  • D. chmod g-rwx
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Stache
1 week, 2 days ago
Selected Answer: A
(A) chmod go-rwx Removing the rwx permissions for groups and owners (go) would make it so ONLY the root user can modify and execute the script. *running "chmod u=rwx" would change nothing and script's permissions would STILL be 777.
upvoted 1 times
...
cj207800
1 week, 3 days ago
Selected Answer: A
Ignore last 777 Which of the following is the MOST appropriate command to ensure only the root user can modify and execute the script? A. chmod go-rwx B. chmod u=rwx C. chmod u+wx D. chmod g-rwx
upvoted 1 times
...
cj207800
1 week, 4 days ago
Selected Answer: B
chmod go-rwx: This command would remove read, write, and execute permissions for group and others but would leave the owner's permissions unchanged. If the owner is not root, this does not achieve the desired outcome.
upvoted 1 times
...
cj207800
1 week, 4 days ago
Selected Answer: B
B. chmod u=rwx This command sets the permissions for the user (owner) to read, write, and execute (rwx) while removing all permissions for the group and others. After executing this command, the permissions would be changed from 777 to 700, meaning only the root user can access and modify the script.
upvoted 1 times
...
surfuganda
10 months ago
Selected Answer: A
A. chmod go-rwx "chmod" is the command used to change the file's mode bits. "go-rwx" specifies that both group (g) and others (o) should have read (r), write (w), and execute (x) permissions removed (-). This command removes the read, write, and execute permissions from both the group and others, leaving only the user (assuming the root is the owner) with the ability to read, write, and execute the script. This makes the script's permissions 700 in octal notation, ensuring that only the root user (assuming root owns the file) can modify and execute the script.
upvoted 3 times
...
K1lroy
1 year, 4 months ago
Selected Answer: A
But we don't have the g=,o= in the available options. Using just "u=rwx" is not going to remove the permissions from group and the others therefore we should remove it with the A: chmod go-rwx
upvoted 2 times
...
comptiaboy
1 year, 8 months ago
Selected Answer: B
Agree with Mareo B
upvoted 2 times
...
Mareo
1 year, 9 months ago
Selected Answer: B
The octal notation "777" represents full permissions (read, write, and execute) for the owner, group, and others. To ensure only the root user can modify and execute the script, we need to remove write and execute permissions for group and others while keeping the same permissions for the owner. Therefore, the most appropriate command would be: B. chmod u=rwx,g=,o= script_file This command sets the owner's permissions to read, write, and execute (u=rwx) while removing all permissions for the group (g=) and others (o=), effectively restricting modification and execution to the root user only.
upvoted 2 times
ccoli
5 months, 2 weeks ago
Nope, it's A which removes read write and execute from group and others.
upvoted 1 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago