You Asked: How Do I Restrict a Root User in Linux?
Contents the Simplest Method to Disable Root User Login Is to Change Its Shell from /Bin/Bash or /Bin/Bash (Or Any Other Shell That Permits User Login) to...
The simplest method to disable root user login is to change its shell from /bin/bash or /bin/bash (or any other shell that permits user login) to /sbin/nologin , in the /etc/passwd file, which you can open for editing using any of your favorite command line editors as shown.
How do I restrict users in Linux?
Limit User’s Access To The Linux System Using Restricted Shell. First, create a symlink called rbash from Bash as shown below. The following commands should be run as root user. Next, create an user called “ostechnix” with rbash as his/her default login shell.
How do I stop root user?
Just type exit and you will leave the root shell and get a shell of your previous user.