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」檔案不會影響使用者登入。