Do you really want to enable root login (in GUI mode, from the login prompt) in Ubuntu 11.10 (Oneiric Ocelot) ? I don’t see any logical reason behind this because if you want to perform some administration task (or any task) then you can use ‘sudo‘ or gain temporary root power in terminal or simply open nautilus in root mode, for browsing such files; one the other hand, if you’ve logged in as root, then a little mistake may corrupt your whole system. That’s why, root account is disabled by default in most of the Linux distributions such as Ubuntu, and so you’re not recommended to enable or use it.
Anyway, if you want to try root (may be – just for Fun!), then in this post, you will learn how to unlock/activate GUI login as root, on Ubuntu 11.10 (although the command is same other versions as well as other Linux distros).
Unlock / Enable root account in Ubuntu 11.10
#1 : Open Terminal (Ctrl+Alt+t) and type the command.
sudo passwd root
#2 : Then you will be asked to enter your login password, followed by the password of ROOT account (enter new UNIX password). Enter it twice, and if everything is ok, then you will get a confirmation message (look at the snapshot of terminal : below).
#3 : Now, it’s the time to test root login in gui mode. To do that – simply logout from the current session and select root as user, and enter the password (entered in above step). That’s all, enjoy root mode (be careful) and return back to your normal user account as soon as possible.
Recommended Alternative ways to gain root power on Ubuntu
Since logging into root account isn’t a good way for administrative purposes, you should any of these methods (it depends on task, e.g for successive administrative task su command will be better) for tasks that requires root permission/power.
Using sudo while performing administrative tasks
The thumb of rule is that, if any command doesn’t executed with the error message then simply – append sudo in beginning and try again. Then it will ask you to enter ‘[sudo] password for user_x‘ – just enter password for user_x. By default it may remember it for next few minutes, so you won’t have to type again for next sudo command.
apt-get install some_program
=> Permission Denied
Then add sudo and try again (enter your login password, remember enter password for ),
sudo apt-get install some_program
=> get your job done!
su command for temporary root power
This command is almost similar to previous one but it requires root password, so root account must be enabled for this to work. To go to root mode, at terminal just type the command, followed by root password.
After entering the correct password, you will be entered into root mode and the prompt will change into (notice the # (indicates root) instead of $ (indicates user) ) –
Run nautilus with root power
If you are doing some files/directory related work then it’s very handy to start the nautilus in root mode. To do that – you can use root browser plugin in nautilus but the command is also very simple. Open terminal and type (any one) –
Update! If you are going to open graphical applications in root mode, then better use gksudo app_name (if you’re using Gnome desktop) or kdesudo app_name (if you’re running KDE desktop). Thanks to @Jak138
I hope you enjoyed reading the article, although this article has been written primarily for Ubuntu but the tips works as expected, in other Linux distros such as Fedora, Linux Mint, OpenSuse, Debian, etc. If any problem occurs or you want to share your experience – then express it through the comment. Have Fun!