Warning: Undefined array key "HTTP_ACCEPT_LANGUAGE" in /home/u596154002/domains/usbusinessreviews.com/public_html/wp-includes/load.php on line 2057

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the rank-math domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/u596154002/domains/usbusinessreviews.com/public_html/wp-includes/functions.php on line 6114
Why sudo is so important in Linux and how to use it - Best Business Review Site 2024

Why sudo is so important in Linux and how to use it

[ad_1]

When I first started using Linux, things were exponentially more complicated. The distributions were far less mature, but they also required the use of a particular system account to get certain things done. That account was root, and with it, you had unlimited power over your operating system. 

To demonstrate the power of root, one trick you could always play on unsuspecting users was to tell them to change to the root user with the command su and then have them issue the following command:

rm -rf /

ZDNet Recommends


The best Linux Foundation classes


The best Linux Foundation classes


Want a good tech job? Then you need to know Linux and open-source software. One of the best ways to learn is via a Linux Foundation course.

The rm command is used to delete files and folders. In conjunction with r (recursive) and f (force), you would delete everything from the root folder (/), thus rendering your system unusable. 

Back then, any command that required administrative privileges was run via the root user. In order to do that, you either had to change to the root user (with the su command) or log in as the root user. Both of these options were eventually considered a security issue. Why? If you logged in as the root user and walked away from your system, anyone could do anything they wanted to it. The same thing holds true with changing to the root user and leaving a terminal window open.

Of course, it’s much more complicated than that. Having access to the root user meant if a hacker gained access to your system, they could then change to the root user and wreck havoc on the machine.

Eventually, it was decided something had to give. Out of that need, sudo was born. Sudo stands for “superuser do” and effectively gives a regular user (one that belongs to the admin group) access to administrator-like powers. This solved two problems:

  • The root user could be deactivated (so it couldn’t be as easily leveraged).
  • Only users in the admin group (more on this in a bit) could run administrative tasks.

This was a significant step forward for Linux, one that not only bolstered the security of the system but also made it easier for users.

With sudo in place, users no longer had to change to the root user or log into that account to run administrative commands (such as installing software). Users could run those admin activities through sudo with the same effect as if they were run from the root user account. On top of that, it offered better control over who could do what on any given system. When attempting to run a command that required admin privileges, a user only had to type their user password (also called their sudo password) and the command would go off without a hitch (so long as it was run properly).

For example, instead of having to first change to the root user with su and then issuing the update/upgrade commands on a Ubuntu-based distribution, you could simply issue the commands:

sudo apt-get update
sudo apt-get upgrade -y

By running apt-get through sudo, the user is granted temporary admin privileges and can successfully issue those commands.

What about users not in the admin group?

With regards to the basics of using sudo, any user that you want to grant access to that particular power has to be a member of the admin group for that distribution. For example, on Ubuntu-based distributions, that group is sudo, whereas, on Red Hat-based distributions, that group is called wheel. 

If you have a user that isn’t a member of the admin group when they attempt to run a command with sudo, they’ll see something like this:

olivia is not in the sudoers file.  This incident will be reported.

How do you fix that? You add them to the admin group. So, for a Ubuntu-based distribution, the command to add a user to the admin group would be:

sudo usermod -aG sudo USER

Where USER is the username in question.

On a Red Hat-based distribution (such as Fedora), that command would be:

sudo usermod -aG wheel USER

Where USER is the username in question.

After running the command, the user would then either have to log out and log back in, or make the system aware of the changes with the command:

newgrp

Once a user has been added to the admin group, they can use sudo to run commands that require admin privileges.

Sudo has made Linux not only more secure but also more user-friendly. No longer having to change to (or log into) the root user account avoids a number of serious security pitfalls and allows you to manage user access to admin tasks. Although this is a very basic introduction to sudo (we’ll be diving in deeper later), you should now have a better idea of what it is and how it’s used.

[ad_2]

Source link

slot gacor slot gacor togel macau slot hoki bandar togel slot dana slot mahjong link slot link slot777 slot gampang maxwin slot hoki slot mahjong slot maxwin slot mpo slot777 slot toto slot toto situs toto toto slot situs toto situs toto situs toto situs toto slot88 toto slot slot gacor thailand slot bet receh situs toto situs toto slot toto slot situs toto situs toto situs toto situs togel macau toto slot slot demo slot pulsa slot pragmatic situs toto deposit dana 10k surga slot toto slot link situs toto situs toto slot situs toto situs toto slot777 slot gacor situs toto slot slot pulsa 10k toto togel situs toto slot situs toto slot gacor terpercaya slot dana slot gacor pay4d agen sbobet kedai168 kedai168 deposit pulsa situs toto slot pulsa situs toto slot pulsa situs toto situs toto situs toto slot dana toto slot situs toto slot pulsa toto slot situs toto slot pulsa situs toto situs toto situs toto toto slot toto slot slot toto akun pro maxwin situs toto slot gacor maxwin slot gacor maxwin situs toto slot slot depo 10k toto slot toto slot situs toto situs toto toto slot toto slot toto slot toto togel slot toto togel situs toto situs toto toto slot slot gacor slot gacor slot gacor situs toto situs toto cytotec toto slot situs toto situs toto toto slot situs toto situs toto slot gacor maxwin slot gacor maxwin link slot 10k slot gacor maxwin slot gacor slot pulsa situs slot 10k slot 10k toto slot toto slot situs toto situs toto situs toto bandar togel 4d toto slot toto slot