Skip to content

5000+ Great Articles

Best Articles & Essays: Interesting Articles to Read Online

  • How To Fix a Stuck Windows 10 Update Windows 10
  • How to Use an Elgato HD60S with a Laptop to Record or Stream Console Gameplay How-To
  • 5 Best Outdoor Smart Plugs of 2019

    Smart plugs add an unprecedented level of convenience to your daily life. You can even control old appliances from your phone via Wi-Fi. Some smart

  • Best ti-84 calculator 2020

    Best ti-84 calculator 2020. 1 - Caseling Graphing Calculator CASE fits TI-84 Plus or TI-83 Plus. And fits the Texas Instruments TI-84 Plus CE or TI-8

  • How to Enable Telnet Server in Windows 10 How-To
  • How to Use Telegram to Send High-Quality Photos & Videos Computer Tips
  • How To Block Someone On Instagram & Facebook Computer Tips
  • 5 Best Professional Photo Recovery Software for Android 2023 Software Reviews

HDG Explains : What Is Sudo & Root On Linux?

Posted on October 7, 2020 By blog_786 1 Comment on HDG Explains : What Is Sudo & Root On Linux?

Getting started with Linux can be a bit confusing. There are tons of new features and terms that you have probably never heard of before. Two such terms are Root and Sudo.

What are Sudo and Root? These two terms are some of the most important ones you expect to find when talking about the most popular Linux distributions. Of course, understanding what they are and how they are used is of the utmost importance.

HDG Explains : What Is Sudo & Root On Linux?

Whether you’re a first-time Linux newbie or a returning user looking to brush up on your knowledge, we’re committed to helping you get back on track. We’ll explain exactly what each one is, how they are used and why they are important.

What is Sudo and Root on Linux? Why are they important?

Each of these two terms is primarily important for accessing specific permissions. More precisely the same permissions. They differ from each other in how to get this access.

HDG Explains : What Is Sudo & Root On Linux?

First, we’ll start with Root, what it is and why it matters.

What is Root?

The root directory, often referred to as the “superuser”, is a special directory represented by a forward slash (/). Root has access to all files and commands on any Unix-like operating system.

– /

HDG Explains : What Is Sudo & Root On Linux?

Not to be confused with the root user’s home directory, which is represented as / root, Root (/) is the starting point for the entire directory, which is hierarchically structured like a tree, and all other directories branch out. from.

Access to root authority

Those who have the necessary permissions to access Root have special privileges that allow them to modify the system at will. These privileges also provide the ability to grant certain access rights to other users. The foolish and reckless use of such power can lead to disaster for the system. You could be dealing with a complete and complete system failure, or at least a damaged system.

This illustrates the importance of a system like Root. It’s pretty much a system. Too much interference can lead to adverse results, so Root should only be used to enable other superuser privileges for specific accounts.

HDG Explains : What Is Sudo & Root On Linux?

By using the visudo command to edit / etc / sudoers, you can grant least privileges to other types of accounts, such as supervisor, where they can add new users and change their accounts without having to enter Root itself.

From now on, these accounts will no longer need Root access and instead can use the sudo command to perform user management tasks. Other tasks will still require superuser permissions, which only the root user can grant. If you ever need to grant additional permissions, you can repeat the steps above, grant them, and then use the logout command to return to your current account immediately.

Avoid using Root to modify anything at the account level. The root should be reserved for system changes only. Apart from the root user, access to other accounts must not be allowed. Add permissions based on the needs of other users and groups, so they can access what they need with the sudo command.

What is Sudo?

HDG Explains : What Is Sudo & Root On Linux?

Sudo, which stands for DO superuser, is one of the most important commands in the Linux system administrator’s arsenal. It allows you to perform certain tasks without the need to log in as root or use the Su (switch user) command.

Importance of Sudo

The Sudo command can help you bypass the annoying “Access Denied” prompt you might encounter when trying to run something in a command terminal. Add the sudo prefix to any Linux command and it will run the specified command with elevated privileges that are required to perform certain administrative tasks.

You can compare sudo to the less friendly version of the Windows User Account Control dialog box that pops up whenever you try to do something important. You know, the one that asks if you want to continue with what you are doing requires you to press YES or OK, and then moves on to the request. Sudo is similar to this, but in practice it is a little more dramatic.

HDG Explains : What Is Sudo & Root On Linux?

Without proper permissions in Linux, things can quickly become inconvenient. Important files that you thought you saved may not have been saved correctly. The original code you are trying to compile does not work. The recently installed program may no longer start. In other cases, you may simply get an Access Denied mark preventing you from moving on. You can avoid all of this by first asking for permission, using sudo as a prefix to your commands.

Something as simple as rebooting your system will require superuser privileges. If you enter reboot mode without sudo, you will receive an “Access Denied” message. Instead, to bypass the annoying prompt, type

sudo restart

You should receive a completely different invitation. The one that tells you that your system will reboot.

After using sudo, you may be asked to enter your account password. Make sure you enter your account password and not the root user account password. If the password is correct, the command should be sent.

Why Sudo is a better alternative to the root (/)

Using sudo is much safer on your system than logging into root and trying to execute commands. You run a greater risk of messing up while you’re in root mode, so it’s easy to run elevated commands without risk.

HDG Explains : What Is Sudo & Root On Linux?

Sudo is also a better alternative to the user switch command (Su). Su will ask for the root password and provide a superuser prompt in the form #. This # means you are in the root directory. At this point, you can execute all elevated commands. The problem occurs when you forget that you are still in the root directory and start running commands that might change your system. Even a simple mistake in the team itself due to a typo can lead to terrible results.

Do yourself a favor and use sudo. Typos, a cat jumping into your lap, and even God’s wrath are less of a threat to your system. Sudo is also the preferred way of working on the Ubuntu distribution. So, if you are using this command, you should be familiar with this command.

Sudoers

We have touched on this topic before, but never discussed what exactly. Sudoers is a file that controls which accounts have access to the sudo command. By default, you can find the file in / etc / sudoers. You can safely edit this file using the visudo command, vi is an elevated editor.

HDG Explains : What Is Sudo & Root On Linux?

Visudo will allow you to edit the sudoers file and save your changes. It will also lock the file, preventing anyone from making changes to it. After you finish editing the file, errors will be analyzed before saving from the file.

The sudoers file contains many different options where you can specify which users from which groups can run certain commands. To give a user the sudo command capabilities, enter the username, followed by a space and the word ALL in capital letters.

username ALL

You can do the same for groups by adding% in front of the group name and then ALL in capital letters.

% groupname ALL

The users and groups you have given sudo permissions to will now have full root privileges.

–

Share this:

  • Twitter
  • Facebook
Linux Tips

Post navigation

Previous Post: How to Use Google Adsense for Beginners
Next Post: 5 Best Software Programs to Manage Dual Monitors

Related Posts

  • An Introduction to Linux for Beginners Linux Tips
  • Ten most useful Raspberry Pi commands Linux Tips
  • How to Uninstall Ubuntu in a Windows 10 Dual-Boot System Linux Tips
  • Display a List of Recently Installed Software Packages in Ubuntu Linux Tips
  • How To Quit Frozen Programs In Linux Linux Tips
  • Common Reasons for Ubuntu Crashes and How to Recover Linux Tips

Comment (1) on “HDG Explains : What Is Sudo & Root On Linux?”

  1. Pingback: What is Sudo in Linux command? - How To Blog

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Archives

  • September 2023
  • August 2023
  • July 2023
  • June 2023
  • May 2023
  • April 2023
  • November 2022
  • September 2022
  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • March 2021
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • December 2019
  • July 2019
  • May 2019
  • April 2019
  • January 2019
  • December 2018
  • November 2018
  • October 2018
  • September 2018
  • August 2018

Categories

  • AI Tools & Guides
  • Amazon Web Services
  • Apple Watch
  • Computer Tips
  • Cool Websites
  • Featured Posts
  • Free Software Downloads
  • Gadgets
  • Gaming
  • General Software
  • Google Software/Tips
  • Hardware
  • Help Desk
  • How-To
  • iOS
  • iPad
  • iPhone
  • islamic Books
  • Linux
  • Linux Tips
  • Mac OS X
  • macOS
  • MS Office Tips
  • Networking
  • Office Tips
  • OS X
  • Product Reviews
  • Reviews
  • Safari
  • Smart Home
  • Smartphones
  • Software Reviews
  • technology
  • text
  • Tools Review
  • Troubleshooting
  • Tutorials
  • Uncategorized
  • Urdu Books PDF
  • Web Site Tips
  • Windows
  • Windows 10
  • Windows 7
  • Windows XP Tips
  • Wordpress
  • 6 Best FTP Clients For Android
  • MailTag: Real-time Email Tracking, Made Easy
  • Here are the Top 10 highest paid YouTubers of 2017
  • Protect Your Facebook Account From Hackers (2017)
  • 4 Ways to Share WiFi Without Giving Away Your Password
DMCA.com Protection Status

Recent Posts

  • How to use Canva Docs to create documents online
  • PS4 won’t turn on but beeps? 9 Fixes Worth Trying
  • How to Create a Vision Board on Canva
  • How to Cancel Your Wall Street Journal (WSJ) Subscription
  • How to Fix Spotify Lyrics Not Showing Up

Recent Comments

  1. How to Cancel Your Wall Street Journal (WSJ) Subscription on How to Cancel Your New York Times Subscription
  2. How to Fix Spotify Lyrics Not Showing Up on How to Delete or Delete Downloads from Spotify
  3. 6 Best FTP Clients For Android on Disney Plus not working on Fire TV? Try These 8 Fixes
  4. Protect Your Facebook Account From Hackers (2017) on Top 5 Facebook Alternative Apps For iOS Devices
  5. 4 Ways to Share WiFi Without Giving Away Your Password on How to fix if PS5 Not Connecting to Internet?
  • The male army height weight chart 2018

    The army height weight chart only for male or man in 2018. For more information visit : Army Maximum Body Fat Standards for Men Age 17-20 = 20 %

  • How to Set up Windows Sonic for Headphones on Windows 10 Windows 10
  • How to Make Fireworks in Minecraft Gaming
  • 3 Wireless Earbud Alternatives to Apple’s AirPods Hardware
  • Samsung One UI Help Tips and HiddenFeatures How-To
  • how to open json file Computer Tips
  • What Is UAC in Windows 10 and How to Disable It ? Windows 10
  • How To Install or Uninstall Safari Extensions on Mac , iPad and iPhone iPad

Copyright © 2023 How To Blog.

Powered by PressBook News WordPress theme

Go to mobile version