Which of the following steps prevents a user from obtaining an interactive login session?

A. Run the command chsh -s /bin/false with the user name.
B. Set the UID for the user to 0.
C. Remove the user from the group staff.
D. Add the user to /etc/noaccess.
E. Create a .nologin file in the user's home directory.

題解

選項 A,「chsh」指令可以改變登入 shell,將使用者的登入 shell 改成「/bin/false」可以讓使用者無法進行登入。

選項 B,將 UID 設成 0 會讓使用者擁有 root 權限。

選項 C,使用者登入和群組並沒有什麼關聯。

選項 D,沒有「/etc/noaccess」檔案。

選項 E,家目錄的「.nologin」檔案不會影響使用者登入。