Root and Sudo in Ubuntu
April 8, 2006 – 10:23 amWell, this is the first confusion I had after installing Linux based Ubuntu. During the installation it created a user account and asked password for it but didn’t asked to creat a root account and set password for it. When I clicked on some applications where a super user priviledges were needed I was asked to enter the root password. Since I set up only one password during the installation, so I assumed that it would work for root account aswell, and it did.
Ubuntu by default restricts direct root account login to make Ubuntu more secure. Default user can take all the actions as super user (user with root or super user priviledges) by providing password whenever needed. You do not need a password to launch and use applications but you do need password when playing around with System Tools, Administration and some tasks in Preferences. Ubuntu documentation clearly states that it is highly recommended not to allow root to login graphically. But isn’t open source software means freedom? Yes it does and if you enjoy freedom by taking risks then you can enable root login via graphical interface. In Gnome, Open System –> Administration –> Login Screen Setup. Click on the security tab and check Allow root login. I am doing great with out enabling root login and I find it quite fun to have full control without switching between sessions.
Default user can run all the Administrative tasks using terminal aswell as Graphical interface for different utilities. Below are a few examples of using sudo in various ways:
To copy paste a file in a directory where you can not normally paste anything without sudo priviledges. For example, when adding fonts into share directory:
sudo cp /home/username/Desktop/fontname.ttf /usr/share/fonts
To launch any application with super user privileges do this:
gksudo gedit
The above given command opens Gedit, default text editor in Ubuntu. You can replace gedit with any other application you want to launch. You can launch your file browser and edit files which you can not normaly edit without super user privileges:
gksudo nautilus
Your password is stored by default for fifteen minutes after this time you will be asked to re-enter super user/ root password.
Ubuntu Wiki has detailed information about using the sudo and root account.
Some similar posts:
One Response to “Root and Sudo in Ubuntu”
Thank you so much for the useful advice–I have always wanted to work in nautilus graphically as root without having to relogin. If Linux wishes for mass adoption they will have to continue to cater to people like me who do not wish to use the command line (they invented a graphical user interface for a reason)!
By Anonymous on Apr 26, 2006