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!
-
2Can you give an example of a change you're trying to make? What you're describing is normal, the root account is the only account that has root access. If you need to use a command that requires root access, you prepend `sudo`, then use your regular account password. – Lewis Smith Nov 01 '18 at 12:59
-
I'm using only one account in my PC. Is there any possible way to change my account type into root account?? Or how can I get root access to my account? – Gayashan Wickramaarachchi Nov 01 '18 at 13:02
-
4Please read these before you try anything. [Why is it bad to log in as root?](https://askubuntu.com/questions/16178/why-is-it-bad-to-log-in-as-root) / [Why is there no option to login as root?](https://askubuntu.com/questions/6676/why-is-there-no-option-to-login-as-root) – Lewis Smith Nov 01 '18 at 13:05
-
I installed VLC player using Ubuntu Software. I'm new to Ubuntu. I want to change my account type as Administrator account in windows. – Gayashan Wickramaarachchi Nov 01 '18 at 13:07
-
It already is, technically. Root restrictions are not there to stop you doing things, they're there to protect your system from the applications you run. This is why `sudo` exists. The system asking for a password to change a setting is no different from UAC in Windows. – Lewis Smith Nov 01 '18 at 13:08
-
That means, all the times when I want to make some changes with Ubuntu, I want to enter the password for that? – Gayashan Wickramaarachchi Nov 01 '18 at 13:13
-
Yes, you enter your account password. – Lewis Smith Nov 01 '18 at 13:13
-
But I saw some tutorials about installing Ubuntu. In there I saw "Install as superuser" on top of window. Is it also same as previously you mentioned? (Please read these before you try anything. Why is it bad to log in as root? / Why is there no option to login as root?) – Gayashan Wickramaarachchi Nov 01 '18 at 13:20
-
You only install individual software as superuser by A) using `sudo` on the command line (e.g `sudo apt-get install vlc`) or B) using the software center, which prompts for your password to elevate the permissions anyway. – Lewis Smith Nov 01 '18 at 13:21
1 Answers
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.
- 410
- 2
- 9