CompTIA Linux+ (XK0-005) — Question 296

Joe, a user, is unable to log in to the system. The Linux administrator checks the /etc/passwd file and reviews the following output:

Joe:x:1002:1002::/home/Joe:/sbin/nologin

Which of the following should the administrator do to fix this issue?

Answer options

Correct answer: B

Explanation

The correct action is to change the login shell from /sbin/nologin to /bin/sh, which will allow Joe to log in. Removing the x entry would compromise the password mechanism, while issuing the usermod -L command would lock the account, and ensuring an entry in /etc/shadow does not directly resolve the login issue.