In some systems, you may not find %wheel instead of %sudo in which case, this would be the line under which you would start modifying. This section of /etc/sudoers often looks like this: # Allow members of group sudo to execute any command Start reviewing and editing below this line: Note: The visudo command will open /etc/sudoers using the system's preferred text editor (usually vi or vim). In order to accomplish that, we will view the contents of /etc/sudoers and edit them where applicable. It is important to ensure that sudoers file located in /etc/sudoers is setup properly in order to allow sudo users to effectively use the sudo command. Usermod -aG wheel mynewusername Step 4: Making sure your sudoers file is setup properly Usermod -aG sudo mynewusername RHEL/CentOS Essentially, there is no real difference except for the syntax used to become root, and users belonging to both groups can use the sudo command. Meanwhile, a sudo user would have use the sudo su first. In CentOS and Debian, a user belonging to the wheel group can execute su and directly ascend to root. For the purpose of this tutorial, we will use the sudo group for Debian. You can however manually add the wheel group using the groupadd command. Note: In Debian, the sudo group is often found instead of wheel. Adding your sudo user to the wheel group is entirely optional, but it is advisable. The wheel group is a user group which limits the number of people who are able to su to root. RHEL/CentOS and DebianĪdduser mynewusername Step 3: Adding the new user to the wheel group (optional) Yum install sudo -y Step 2: Adding the sudo userĪ sudo user is a normal user account on a Linux or Unix machine. In this tutorial, we will be covering the basic steps for disabling direct root access, creating a sudo user, and setting up the sudo group on RHEL/CentOS and Debian Linux systems. The use of a sudo user is often coupled by disabling direct root access to one's server in an effort to prevent unauthorized access. Using a sudo user to access a server and execute commands at root level is a very common practice among Linux Systems Administrators. How To Install and Configure Sudo on RHEL/CentOS and Debian
0 Comments
Leave a Reply. |