menu
techminis

A naukri.com initiative

google-web-stories
source image

Dev

4w

read

411

img
dot

Image Credit: Dev

How to create a sudo user

  • Root user in Linux has the highest privileges but it's discouraged to be used regularly to prevent security issues. A sudo command allows a regular user to execute administrative tasks. A sudo user is a normal user that can execute a sudo command by adding a normal user to the sudo system group.
  • To create a sudo user, a Linux server with root access is required. Firstly, a new user needs to be added using the 'adduser' command followed by prompts to assign a password and other optional information. Once the user is added, it's privileges then need to be elevated to superuser using the 'usermod' command where the new user account is added to the sudo system group.
  • To verify the sudo user, switch to the newly created user and try to run administrative tasks using the 'sudo' command followed by the task.
  • FreeBSD requires the sudo package to be installed before its usage.
  • To create a sudo user on FreeBSD, you need to install sudo using ports or pkg, and then create the user account followed by assigning the wheel group to the newly created user. Finally, the sudoers file needs to be edited to include the wheel group to allow them to run all commands.
  • When editing sudoers file, visudo should be used instead of editing it directly because it checks for errors before saving any changes.
  • Rocky Linux steps not included because they are not available at the time of writing.

Read Full Article

like

24 Likes

For uninterrupted reading, download the app