Some accounts are not associated with a human user of the system, and exist to perform some
administrative functions. Should an attacker be able to log into these accounts, they should
not be granted access to a shell.
The login shell for each local account is stored in the last field of each line in
/etc/passwd
. System accounts are those user accounts with a user ID less than
1000
. The user ID is stored in the third field. If any system account
other than root
has a login shell, disable it with the command:
$ sudo usermod -s /sbin/nologin account