Root account is disabled by default, in Ubuntu and some other GNU/Linux distributions because the super user created by default (during installation process) can easily gain root privileges through the help of sudo (super user Do) command. But in some cases it might be good to have access to root power in GUI mode (or may be just for fun), although I’m sure most of such administrative tasks can be easily accomplished by sudo utility (which is installed by default in Ubuntu).
Unlocking Root Account in Ubuntu 12.04 LTS (Precise Pangolin)
Open a terminal (Ctrl+Alt+t) and execute the command –
sudo passwd root
Then enter the root password twice (followed by your login password). Then logout from the current session and choose root user at login prompt. Then you can enjoy root power in GUI mode. Or you can use su command to gain root power at terminal –
Then enter root password and Enjoy 🙂
NOTE : But actually you shouldn’t be using root account for administrative tasks. simply use sudo (if you want to gain root power in terminal) or gksudo or gksu for GUI applications such as File Manager. So if any command requires root power i.e gives permission denied error or something like that then just put sudo before that command.
Open Nautilus with ROOT privileges (it’s required unless you do file management over command line – in that case sudo will work fine)
For KDE Desktop users KDESUDO utility is there (it’s a frontend for sudo) –
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!
Ubuntu 11.04 handles file permissions in the same way as any other Linux Based distribution. File Permission is a advanced security policy that controls the administrative right to the files based on some rules and settings. The main purpose of the file system is to protect the files from unauthorized access. Ubuntu or Linux based OS has very secure and robust file permission Rules.
Due to the File permission rules and settings, some times it’s very annoying, specially for advanced users. Ubuntu provides ‘sudo’ command (Just add the ‘sudo’ term in the beginning of the command, that you want to execute), that allows the normal users to perform administrative tasks. But sometimes it’s good to have full root power! without any sudo, in GUI mode, it seem dangerous but if you deliberately want this, then this post will explain how to gain root power (or unlock/enable ROOT in Ubuntu) in GUI mode, on Ubuntu 11.04 (Natty Narwhal).
Enable (Unlock) root on Ubuntu 11.04
#1 : Open Terminal/shell , (hit CTRL+ALT+T)
#2 : Then, Type the command (Followed by your Login Password).
sudo passwd root
#3 : when you will be prompted for “Enter the New Unix Password” Twice, Enter the root password.
#4 : That’s All, To enjoy root power, logout from the current user session. At the login window, Enter ‘root’ as a username and the password, you entered in above step.
Conclusion : In root mode, don’t perform any action about which you aren’t sure, because a single mistake can cause a lot of damage. If you just want to browse files in root mode, then you can browse nautilus in root mode with one simple trick.
Browse Files in Root Mode with Nautilus
Open terminal and enter the command (of course, followed by your login password).
The strict security policy of the ubuntu doesn’t allow you to login as root.Its strictness seems somewhat meaningfull when we think about the novice linux users(who just migrate fr0m the windows world) because their system may become unstable or may corrupt due to a little mistake if they have the power of root in gui mode.
But it is very frustrating when it comes to experienced users.Although we can do it fr0m command line interface(Using sudo) but we are not masochist because if we can enable the root login in gui mode then it is fine(Although efficiency may be different in both cases but in this high computation world we can neglect those little difference) and enjoyable.Lets come to the point-
Actually we can enable root login in ubuntu latest versions like 9.10 0r 10.04(Lucid Lynx) very easily by using a command sudo passwd.