Which of the following commands will you use?

You work as a Network Administrator for Tech World Inc. The company has a Linux-based
network.
The permissions on a file named Report are shown below:
rwxr–r–You want to add a sticky bit to the file. Which of the following commands will you use?

You work as a Network Administrator for Tech World Inc. The company has a Linux-based
network.
The permissions on a file named Report are shown below:
rwxr–r–You want to add a sticky bit to the file. Which of the following commands will you use?

A.
chmod 2744 report

B.
chmod 4744 report

C.
chmod 7744 report

D.
chmod 1744 report

Explanation:

When 1 is added as a prefix to the permission set, it adds the sticky bit to the file permission.
Therefore, in order to accomplish the task, you will have to run the following command: chmod
1744 report
What is sticky bit?
The sticky bit is a part of a permission set applied to files or folders. The sticky bit prevents others
from deleting files from a folder. When the sticky bit is set on a directory, only the owner or root
can unlink (delete) or rename the files in that directory. Without the sticky bit, anyone who is able
to write to the directory can delete or rename the files.
Answer option A is incorrect. This will set SGID to the file permission.
Answer option B is incorrect. This will set SUID to the file permission.
Answer option C is incorrect. Although this will add a sticky bit to the file permission, it will also set
SGID and SUID to the file permission.
What are SUID and SGID?
Set user ID (SUID) and Set group ID (SGID) are used to set a file to run as something other than
the standard. Normally, when a file is executed, it runs as the user who invokes it. Setting a file to
SUID or SGID simply requires adding an extra digit to the permissions. Technically, if no digit is
used, it assumes a leading 0.



Leave a Reply 0

Your email address will not be published. Required fields are marked *