HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

nologin — Alternative shell that prevents a user from logging in. More information: <https://manned.org/nologi

Submitted by: @import:tldr-pages··
0
Viewed 0 times
thatshellcommandpreventsalternativecliusernologin
linux

Problem

How to use the nologin command: Alternative shell that prevents a user from logging in. More information: <https://manned.org/nologin.8>.

Solution

nologin — Alternative shell that prevents a user from logging in. More information: <https://manned.org/nologin.8>.

Set a user's login shell to nologin to prevent the user from logging in:
chsh {{[-s|--shell]}} {{user}} nologin


Customize message for users with the login shell of nologin:
echo "{{declined_login_message}}" > /etc/nologin.txt

Code Snippets

Set a user's login shell to `nologin` to prevent the user from logging in

chsh {{[-s|--shell]}} {{user}} nologin

Customize message for users with the login shell of `nologin`

echo "{{declined_login_message}}" > /etc/nologin.txt

Context

tldr-pages: linux/nologin

Revisions (0)

No revisions yet.