How  Disable Normal User Logins in Linux

Résultat de recherche d'images pour "linux login"
14px; padding: 0px; vertical-align: baseline; word-wrap: break-word;">How to Block User Logins Using nologin Shell
This method works a little differently: it only blocks a user from accessing a shell. But he or she can log on to the system via programs such as ftp that do not necessarily require a shell for the user to connect to a system.
Additionally, it can allow you to block shell access to specific users in special scenarios.

On RHEL/CentOS/Fedora

Simply use chsh (change shell) command to change the users shell in /etc/passwd file from something like /bin/bash or /bin/sh to /sbin/nologin meaning refuse a login.
# chsh -s /bin/nologin tecmint

On Debian/Ubuntu

Here, you have to use /bin/false file. The command below changes the user tecmint’s shell to /bin/falsemeaning do nothing (after user provides login credentials):
$ sudo chsh -s /bin/false tecmint
You may also like to read these following related articles.
  1. How to Enable and Disable Root Login in Ubuntu
  2. Resetting/Recovering Forgotten Root User Account Password in RHEL/CentOS 7
  3. How to Restrict SFTP Users to Home Directories Using chroot Jail
  4. How to Set and Unset Local, User and System Wide Environment Variables in Linux
That’s all for now! If you have any questions or additional ideas to share concerning this topic, make use of the comment form below.

Article source http://ift.tt/2vRmrAl

Subscribe to receive free email updates:

Related Posts :

0 Response to " "

Post a Comment