From https://unix.stackexchange.com/a/314732/674
In contrast to user accounts, service accounts often don't have a "proper" login shell, i.e. they have /usr/sbin/nologin as login shell (or, back in the old days, /bin/false). Moreover, service accounts are typically locked, i.e. it is not possible to login (for traditional /etc/passwd and /etc/shadow this can be achieved by setting the password hash to arbitrary values such as * or x).
It seems to give several ways to prevent a user from login.
the shell field of
/etc/passwd
:nologin
,/bin/false
, /bin/true,
/dev/null`;the password field of
/etc/shadow
:*
orx
What are the differences between their purposes? Do they all achieve the same purpose?
Thanks.