[ILUGC] 1D1C - nologin

  • From: Dhanasekar <tkdhanasekar@xxxxxxxxx>
  • To: ilugc@xxxxxxxxxxxxx, kanchilug@xxxxxxxxxxxxx
  • Date: Fri, 25 Nov 2022 06:00:00 +0530

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

Other related posts: