nologin - politely refuse a login
To find the nologin path
$ type nologin
or
$ command -V nologin
check for nologin shell
$ less /etc/shells
if not found add it
# echo "/usr/sbin/nologin" >> /etc/shells
usermod the user with nologin
$ sudo usermod -s /usr/sbin/nologin ilugc
ilugc userâs new login shell is set to /usr/sbin/nologin
try to login with user ilugc
$ ssh ilugc@server_ip
To restrict access for a new user accounts
$ sudo useradd -s /usr/sbin/nologin chennaipy
check with
$ cat /etc/passwd | grep chennaipy
regards,
T.Dhanasekar
---
Mailing List Guidelines: https://ilugc.in/mailing-list-guidelines
Web: http://ilugc.in/
Internet Relay Chat: #ilugc on libera.chat