Enabling Root Account
From TheLinuxVault
Ubuntu is installed with the root account "disabled". The sudo command is the recommended way of utilizing root privileges but for some people this is an annoyance. Enabling the root account is not recommended. For more information and the reasons why, read this security article.
Contents |
[edit] WARNING
If you enable and use a GUI login as root, your Ubuntu won't be a pure system anymore: It is against all Ubuntu wisdom [Todo: Ubuntu Philosophy]. It is also unneccessary and dangerous.
[edit] Administration the Ubuntu Way
It is not necessary to enable the root account to get a root shell. Instead, use: For a single command:
$ sudo <command>
For running multiple commands:
Longterm superuser shell:
$ sudo -i
OR For a real root shell:
$ sudo su
For KDE GUI apps:
$ kdesu <application>
For GNOME GUI apps:
$ gksudo <application>
This is the reason Linux is so secure - because nothing ever has enough privileges to do any damage - except root. Never is it desirable. For extensive system administration get in the group sudo for a while. Then you do not need to give a password anymore. But do not forget to disable your sudo group membership. Keep in mind you need to keep membership in the group admin to have sudoers privilege!
[edit] GUI Alternative
If, despite the above warning, you feel you need to enable root, perform the following:
Go to: System -> Administration -> Login Window
Go to the Security tab and check the box labelled "Allow local system administrator login". This only applies if root has been given a password.
Go to System -> Administration -> Users and Groups
Select root and click Properties. In the password section select "Set password by hand" and enter the desired password. Root cannot be disabled via the GUI. For this use the terminal command.
[edit] Terminal Commands
[edit] Enabling Root
To enable the root account by giving it a password open a terminal and type:
$ sudo passwd
When the prompt appears choose a new password and confirm. A warning will be given if you choose a "weak" password but you can enable it regardless.
[edit] Disabling Root
To disable the root account run the following command in a terminal:
$ sudo passwd -l root

