How to give user root rights in Ubuntu Linux, Linux programming course Baku

How to give user root rights in Ubuntu Linux, Linux programming course Baku

Articles

One of the fundamental principles of OS security is limiting user rights. According to this concept, only administrators can make significant changes to the OS, while regular accounts have only the privileges absolutely necessary for their operation. Today, we'll cover how to grant root privileges to an Ubuntu account. This knowledge is included in the Linux programming course in Baku on the SEDICOMM University platform.

What are superuser rights (root), Linux programming course Baku

First of all, let's understand what superuser rights are in Linux . Of course, this topic is covered in detail in the Linux Baku advanced training program. The root account has these rights . With these access rights, you can:

  • make changes to the kernel operation, main OS settings files;
  • create and delete file systems, format and mount them;
  • change security settings, including firewall settings;
  • install and remove software packages and their dependencies;
  • change access rights and file ownership settings.

This is just a short list of situations that require administrator access. On the other hand, even the most experienced system administrator should avoid constantly working as root . First and foremost, it's against cybersecurity requirements. Furthermore, it can accidentally damage the operating system or the data on the drive. Some Linux commands can quickly turn a typo into a major problem.

For this very reason, a temporary root privilege for a specific command has been created. The sudo command (short for " Substitute User and Do ") is typically used for this purpose . Simply add it before the command that requires the appropriate privileges. The command shell will then prompt you for your account password.

An important clarification: we're talking about the password for your account, not the root account . Most users simply aren't supposed to know it, nor do they need to. The sudo command will allow you to run another command with all the necessary privileges. But only if your account has received such permission from a true OS administrator. For more information, check out the Linux Baku advanced training courses.

How to Grant a Linux User Account Root Privileges

To enable a user to use the sudo command , they must be added to the appropriate group. To do this, use the usermod command with the -aG option and two space-separated arguments:

  • the first argument is sudo (the group to which the user should be added)
  • The second argument is the user account name.

This operation will allow the corresponding account to execute commands with root privileges using sudo . However, this user will still not know the root password . This ability can be revoked at any time by simply removing them from the group.

It's worth noting that you can grant an account sudo privileges only for a specific set of commands. This is done by adding data to the /etc/sudoers file. Learn more about this at Linux Advanced Training Distance Learning in Baku on the SEDICOMM University platform.

SEDICOMM University Team : Cisco Academy , Linux Professional Institute , Python Institute.