Which of the following commands set the sticky bit for the directory /tmp? (Choose TWO correct answers.)

A.

chmod +s /tmp

B.

chmod +t /tmp

C.

chmod 1775 /tmp

D.

chmod 4775 /tmp

E.

chmod 2775 /tmp

题解

「chmod」指令用来改变文件的权限,可传入四个八进位数字,由左至右分别表示特殊权限、拥有者权限、群组权限和其他人权限。「sticky bit」属于特殊权限的部份,用于目录,在拥有「sticky bit」的目录中,用户只能删除自己创建的文件,且该目录的其他人运行权限为「t」。特殊权限的数字若为「4」,表示「SUID」;若为「2」,表示「SGID」;若为「1」,表示「sticky bit」。因此这题答案是选项 B 和选项 C。