setuid 是 UNIX 的檔案權限管理其中一種旗標(flag),一個可執行檔被加入 setuid 權限後,就可以允許此可執行檔的執行者暫時性的轉換身分為檔案所有者,來存取該使用者所屬檔案,以便順利執行此可執行檔。下列指令何者可以用來設定可執行檔 test 的 setuid?
Achmod g+s test
Bchmod 4777 test正確答案
Cchmod u-s test
Dchmod 2777 test
答案與詳解
4777 中的 4 代表 setuid 位元,後面 777 代表 owner/group/other 皆可讀寫執行。正確設定 setuid 的寫法。
