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.
#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
#Applicable to all debian based linux distributions like Ubuntu, etc
Find a User's default shell
[root@server ~]# cat /etc/passwd
0 comments:
Post a Comment