QuestionQ195

VerifiedUsers and Groups

Which of the following actions would stop a user from being able to start an interactive login session?

Explanation

Changing a user's default shell to /bin/false (or /sbin/nologin) using the chsh -s /bin/false command causes any interactive login attempt for that account to immediately terminate, since the assigned shell does nothing and exits right away. This is the standard technique administrators use to disable interactive shell access for an account while still allowing the account to remain active for non-shell purposes such as file transfer or running specific daemons. The other listed actions do not achieve this: setting UID to 0 grants superuser privileges rather than restricting access, removing group membership only affects file/resource permissions, /etc/noaccess is not a recognized Linux mechanism, and the nologin mechanism (/etc/nologin) is a system-wide file, not a per-user home directory file.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!