I installed Ubuntu 18.04 just now. I removed windows 7 and installed Ubuntu as my primary OS. And the problem is it asks root password every time when I make changes in it. Thank you!
1 Answer
In standard Ubuntu, root
logins are not allowed, neither from the GDM (graphical) login manager, nor from the text console (i.e., the one you get if press Ctrl+Alt+F1).
In order to perform root
(i.e., administrator) operations you have to use the sudo
command in a terminal, or any GUI equivalent of it: these will ask you for your password and then perform the requested privileged operation (and only that one).
The reason for this behavior is, as others have pointed out, that performing root
operations is inherently risky and the number of operations really requiring root
privileges is comparatively small: by using this sudo
approach you are running most of the time with a unprivileged account (i.e., harmless to the system and other users) and just get the root
powers when it's really needed.
An example might help clarify. Assume you want to install a new service (daemon) on your machine; this is relatively new and you need to read about it and how to configure it to your needs. You will end up browsing the web a lot to find information, example configs, etc., maybe have some IRC chat to ask for more info -- none of this requires root
powers! In the end, you only need privileged access for two operations:
- install the new program (i.e.,
sudo apt-get install ...
), and - edit the default configuration
A commonly accepted principle in computer security is always use the least possible privilege level to perform an operation. -- this reduces the risk that something bad happens because of bugs in the software or errors from the operator.
The Ubuntu default setup goes in this direction; if you were using a root
login, instead, you would have ended up surfing the internet, doing IRC (and possibly all the other stuff that one does concurrently) from the root
account, thus needlessly exposing the system to a threat.
sudo
, then use your regular account password.sudo
exists. The system asking for a password to change a setting is no different from UAC in Windows.