4.5.3.1 Ensure nologin is not listed in /etc/shells

Information

/etc/shells is a text file which contains the full pathnames of valid login shells. This file is consulted by chsh and available to be queried by other programs.

Be aware that there are programs which consult this file to find out if a user is a normal user; for example, FTP daemons traditionally disallow access to users with shells not included in this file.

Rationale:

A user can use chsh to change their configured shell.

If a user has a shell configured that isn't in in /etc/shells, then the system assumes that they're somehow restricted. In the case of chsh it means that the user cannot change that value.

Other programs might query that list and apply similar restrictions.

By putting nologin in /etc/shells, any user that has nologin as its shell is considered a full, unrestricted user. This is not the expected behavior for nologin.

Solution

Edit /etc/shells and remove any lines that include nologin

See Also

https://workbench.cisecurity.org/benchmarks/15288

Item Details

Category: IDENTIFICATION AND AUTHENTICATION

References: 800-53|IA-5

Plugin: Unix

Control ID: c4d5bdd03be293f88bb5e098cab46195fd2d18525b21de06830166c9fc7686ed