ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 74 - XK0-005 discussion

Report
Export

A Linux engineer is setting the sticky bit on a directory called devops with 755 file permission. Which of the following commands will accomplish this task?

A.
chown -s 755 devops
Answers
A.
chown -s 755 devops
B.
chown 1755 devops
Answers
B.
chown 1755 devops
C.
chmod -s 755 devops
Answers
C.
chmod -s 755 devops
D.
chmod 1755 devops
Answers
D.
chmod 1755 devops
Suggested answer: D

Explanation:

The command that will set the sticky bit on a directory called devops with 755 file permission is chmod 1755 devops. This command will use chmod to change the mode of the directory devops to 1755, which means that the owner has read, write, and execute permissions (7), the group has read and execute permissions (5), and others have read and execute permissions (5). The first digit 1 indicates that the sticky bit is set on the directory, which is a special permission that prevents users from deleting or renaming files in the directory that they do not own.

The other options are not correct commands for setting the sticky bit on a directory. The chown -s 755 devops command is invalid because chown is used to change the owner and group of files or directories, not their permissions. The -s option for chown is used to remove a symbolic link, not to set the sticky bit. The chown 1755 devops command is also invalid because chown does not accept numeric arguments for changing permissions. The chmod -s 755 devops command will remove the sticky bit from the directory devops, not set it. Reference: chmod(1) - Linux manual page; How to Use SUID, SGID, and Sticky Bits on Linux

asked 02/10/2024
Jordan Pfingsten
44 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first