When you have just started using Linux, you’ll find many things that are different from Windows. One of those ‘different things’ is the concept of the root user.
In this beginner series, I’ll explain a few important things about the root user in Ubuntu.
Please keep in mind that while I am writing this from Ubuntu user’s perspective, it should be valid for most Linux distributions.
You’ll learn the following in this article:
- Why root user is disabled in Ubuntu
- Using commands as root
- Switch to root user
- Unlock the root user
What is root user? Why is it locked in Ubuntu?
In Linux, there is always a super user called root. This is the super admin account that can do anything and everything with the system. It can access any file and run any command on your Linux system.
With great power comes great responsibility. Root user gives you complete power over the system and hence it should be used with great cautious. Root user can access system files and run commands to make changes to the system configuration. And hence, an incorrect command may destroy the system.
This is why Ubuntu and other Ubuntu-based distributions lock the root user by default to save you from accidental disasters.
You don’t need to have root privilege for your daily tasks like moving file in your home directory, downloading files from internet, creating documents etc.
Take this analogy for understanding it better. If you have to cut a fruit, you use a kitchen knife. If you have to cut down a tree, you have to use a saw. Now, you may use the saw to cut fruits but that’s not wise, is it?
Does this mean that you cannot be root in Ubuntu or use the system with root privileges? No, you can still have root access with the help of ‘sudo’ (explained in the next section).
Root user is too powerful to be used for regular tasks. This is why it is not recommended to use root all the time. You can still run specific commands with root.