Professional Documents
Culture Documents
Ubuntu has the root account disabled and encourages the use of sudo to run commands as root. If you are
doing some work requiring root access, it can be tiresome to type sudo over and over. The normal way to get
a root shell is the su command, which doesnt work in Ubuntu.
This command is the equivalent of su for Ubuntu, it asks for your password and switches to the root user:
sudo -s
And dont forget to type exit to switch back to your normal user when you are done.
SUDO!!
use the SUDO command before any other commands and it will be used as "ROOT" command!the pass is
the one you created at setup / aka the DEFAULT LOGIN Pass ;)f.ex "sudo apt-get update" then it asks for
password, say the pass is "iloveubuntu" u type that in! (PS: You won't see the pass come up, but just type it
in and press enter)Have fun, hope it works! :)
sudo means superuser do. sudo will prompt for Password:. Please specify user password
As you have noticed during the Ubuntu installation there was no question about the root password, as you
might have been used to see during other Linux distribution installation process.Because of this your root
accout is inactive.
If you want to enable root account (which is not recommended) enter the following command.
$sudo passwd root
This will prompt for a new root password and once you confirm it, you can start using the root account to
login.
If you want to disable root account in ubuntu you need to lock the root account by using the following
command
$sudo passwd -l root
If you want to work on a root console youd better use the following command
$sudo -I
Ubuntu 9.10 (Karmic Koala) rel 2009
Download page:
http://old-releases.ubuntu.com/releases/karmic/
http://ftp.heanet.ie/pub/ubuntu-releases/9.10/ubuntu-9.10-desktopi386.iso
============
# mkdir recovery
# mount /dev/hda3 recovery
# cd recovery/etc
# vi shadow
# vi passwd
Scroll down to the line containing the root users information, which looks something like
root:weeWRSF!sfDFs:12581:0:99999:7:::
Delete everything between the first and second colons, so that the line looks like
root::12581:0:99999:7:::
Save the file and exit your editor.Type cd to return to your home directory.
Type umount mountplace to unmount the partition.
#unmount /dev/hda3 recovery
Type reboot to reboot your system
The advantage of this approach over the previous method is one does not need to know the lilo password .
But to use it one must be able to access the BIOS setup to allow the system to boot from floppy disk or CD,
if that is not already set.
Solution 3
Reseting passwords by mounting on another system and editing the password file is bit more work need to
be done.first you need to Shut down the machine after backing up all important data.Now remove you
machine hard disk and connect this hard disk as slave drive for another machine(this should be linux OS)
and boot this machine.Once the system finishes booting, mount the slave drives root partition and edit the
password file.If /dev/hda3 is the original root partition, the following will let one edit the password file just
as easily as the above.
# mkdir recovery
# mount /dev/hda3 recovery
# cd recovery/etc
# vi shadow
# vi passwd
Scroll down to the line containing the root users information, which looks something like
root:weeWRSF!sfDFs:12581:0:99999:7:::
Delete everything between the first and second colons, so that the line looks like
root::12581:0:99999:7:::
Save the file and exit your editor.Type cd to return to your home directory.
Type umount mountplace to unmount the partition.
#unmount /dev/hda3 recovery
Type reboot to reboot your system
If you want to prevent others from resetting your root password you can use two options first one is protect
your bootloader with password i.e your GRUB or LILO boot loaders and second one is protect BIOS with
password.
==============