Pages

Tuesday, June 20, 2006

Ubuntu 6.06: setting up the root password

For some reason, Ubuntu installer won't let you choose password for root user during the installation of the operating environment (OE). Then how do we run commands which need root privileges? The answer is simple: by using sudo.

From what I read/understand, the user that we create during the installation of OE will have sudo privileges to run root only commands. But I am pretty sure that it is inconvenient to prepend the string sudo before all such commands. So, it is better to login as root user rather than the normal user, when a large number of "root only" commands/tools/utilities needs to be run. The first step is to set the password for the root user. Use the sudo privileges of the default user to run passwd root command. Enter the password string of the default normal user when it prompts for password with an useful hint: enter your non-root user password. Type in the password chosen for the root user, when you are prompted to enter the new UNIX password with another useful hint: enter new password for root. Re-type the chosen password one more time in the next step, and you are done.

 % sudo passwd root
 Password: (enter your non-root user password) <- default normal user's password
 Enter new UNIX password: (enter new password for root) <- choose a password for the root user. It is different
from the one you typed in previous step -- and of course the default normal user's
password is not going to change after this step.

 Retype new UNIX password: (re-enter new password for root)
 passwd: password updated successfully

Perhaps the steps are the same for earlier versions of Ubuntu - but this is the very first time I have ever got my hands on Ubuntu distro.
_______________
Technorati tags: |

2 comments:

  1. It's a small world, I installed Ubuntu a few days ago, and ran into the same problem. It didn't occur to me to use sudo to set the root password, I just used sudo to execute all the root commands I needed to run.

    ReplyDelete
  2. Actually if you are a normal user say "joe" and you type "sudo -i", you'll get dropped into an interactive shell as user "root".

    ReplyDelete