Wednesday, June 18, 2008

SUDO PASWORD IN UBUNTU

One way to gain root prompt is to launch a shell as root. Therefore, using sudo you can type:

:~$ sudo sh
Password:
sh-3.1#

And there you are, you have a root shell.

If you want to be able to login as root, you need to define a password for root:

:~$ sudo passwd
Password:
Enter new UNIX password:
Retype new UNIX password:

Now you can login as root with su.

Re-disabling your root account

If for some reason you have enabled your root account and wish to disable it again, open a terminal and issue the following command:

sudo passwd -l root