Deny Terminal And Graphical Login To Linux Users

Q: How to Deny users to login with terminal or GUI ?

To Restrict normal linux users to login into the operating system via terminal or Graphical login (GUI) change their default shell to "nologin". Same time allowing them to access other services like FTP, E-Mail login, Samba, etc.

Change User's Default Shell (RPM Linux)
[root@server ~]# usermod -s /sbin/nologin accountant
#The above command will modify the default shell to nologin shell (for user accountant)
And applicable to RPM based distributions like Fedora, CentOS, Redhat, etc.

Change User's Default Shell (Debian)
user@ubuntu:~$ sudo usermod -s /bin/false accountant
#Applicable to all debian based linux distributions like Ubuntu, etc

Find a User's default shell
[root@server ~]# cat /etc/passwd

Was this helpfull ?


Related Posts Plugin for WordPress, Blogger...

Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Bluehost Coupons