Description
/etc/shells lists the valid login shells. Some programs, like chsh and FTP servers, use it
to decide whether an account may log in. nologin exists precisely to refuse logins and must
not appear there.
Rationale
Listing nologin makes service accounts look like regular users to programs that rely on
/etc/shells, which can open them to FTP logins or let users switch to it and back.
Impact
None known. Ubuntu does not list it by default.
Audit
Run grep nologin /etc/shells. There must be no match.
Automated: every check must pass. Scanners report each check by its id.
shells
path: /etc/shells
pattern: nologin
expect: no_match
Remediation
Remove the nologin lines from /etc/shells.
| Restart | none |
| Disruption | none |
remove
cb_backup /etc/shells
sed -i '/nologin/d' /etc/shells
Handwritten code reads parameters from CB_<NAME> environment variables. Each release turns these fixes into remediate.sh and an Ansible role per profile: dry run by default, a fix runs only when its check fails.
References
- shells(5), Ubuntu manual pages Canonical, vendor-doc, accessed 2026-10-19
Mappings
| Framework | ID | Relation |
|---|---|---|
| NIST SP 800-53 Rev. 55.1.1 | CM-6 | related |
How this control relates to the other framework's: equivalent, stricter, looser, partial or related.
Threats mitigated
| Taxonomy | ID |
|---|---|
| MITRE ATT&CK | T1078.003 |
People and lifecycle
| Authors |
|
| Verified | 2026-10-19 by Sn0wAlice on 20.04, Proxmox VM, Ubuntu 20.04 cloud image, kernel 5.4.0-216-generic. Passes on a fresh install; profile server-hardened. |
| Verified | 2026-10-19 by Sn0wAlice on 22.04, Proxmox VM, Ubuntu 22.04 cloud image, kernel 5.15.0-198-generic. Passes on a fresh install; profile server-hardened. |
| Verified | 2026-10-19 by Sn0wAlice on 24.04, Proxmox VM, Ubuntu 24.04 cloud image, kernel 6.8.0-147-generic. Passes on a fresh install; profile server-hardened. |
| Verified | 2026-10-19 by Sn0wAlice on 26.04, Proxmox VM, Ubuntu 26.04 cloud image, kernel 7.0.0-38-generic. Passes on a fresh install; profile server-hardened. |
| Introduced in | v0.1.0 |
| Created, updated | 2026-10-19, 2026-10-19 |
| Translations | fr |