You are on page 1of 6

Get root terminal in Ubuntu

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! :)

HOW TO LOGIN AS ROOT IN UBUNTU


Many people want to know how to obtain root permission on Ubuntu no matter su command or login x
window.
The root passwd have never been configured when you install ubuntu first time.
You can use below command to change root password.
$sudo passwd root
Now, you can use su command as below.
$su #
===============
You're instructions don't work for Ubuntu 10.10. There's no Login Window, just a Login Screen. This doesn't
have an "Allow local system administrator login" option.
Anonymous
May 1, 2011 10:51 PM
it still works, you can skip
"1. Select Login Window option System --> Administration --> Login Window"
and
"2. Please click this option --Allow local system administrator login"
instead just switch user and login with
username: root

password: the one you entered earlier


Jan
August 28, 2011 2:36 AM
there is a user root off course, but this user is not visible in the gui of 10.04. so I cannot switch to that user
Anonymous
September 20, 2011 6:08 AM
"sudo su - " grants root access on Ubuntu 10.04 LTS.
Is that a better security? I hope the folks at Ubuntu drop their foolish security scheme and return to the old
ways, until something better is set up.

Enable and Disable Ubuntu Root Password


Ubuntu is one of the few Linux distributions out there that will not enable the root account.If you want to
do something with root permission on the console you have to type sudo before the command.

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
============

How to Reset debian Root Password


If you forgot your root password for your debian server use the following procedure to reset.
Boot to the GRUB menu. Then, press <e> (for edit) before Linux has a chance to boot.
Using your keyboard arrow keys, move the cursor down a line or so, and press <e> (for edit) again, you
should now be on the kernel line, and press <End> to go out to the very end of that line. Now hit the
spacebar once, if necessary, to add a space, and then add one of the folllowing:
init=/bin/bash
or
init=/bin/sh
Then press <Enter>, and youre back at the kernel line, press <b> (for boot) and the computer will proceed
to boot to a root prompt.
At this point, the root file system is still mounted read-only, so enter the following command:
mount -n -o remount,rw /
Then type:
passwd
Enter your new password. Retype if asked to confirm.
Then restart the machine by typing:
reboot
Now you should be able to login with your new root password as required.
=============

Forgot root password or reset root password in Debian


There are times for system administrators they might have forgot their debian machine root password and
they want to reset this password.We will see the available options.

There are various methods available for resetting a root password.


Boot debian linux into single-user mode
Boot using a boot disk (like knoppix,gnoppix) and edit the password file
Mount the drive on another computer and edit the password file
It is possible to boot a system and log on to the root account without knowing the root password as long as
one has access to the console keyboard.
This is a procedure which requires no external boot disks and no change in BIOS boot settings. Here,
Linux is the label for booting the Linux kernel in the default Debian install.
Solution 1
At the lilo boot screen, as soon as boot: appears (you must press a shift key at this point on some systems to
prevent automatic booting and when lilo uses the framebuffer you have to press TAB to see the options you
type), enter:
boot: Linux init=/bin/sh
This causes the system to boot the kernel and run /bin/sh instead of its standard init. Now you have gained
root privileges and a root shell. Since / is currently mounted read-only and many disk partitions have not
been mounted yet, you must do the following to have a reasonably functioning system.
# mount -n -o remount,rw /
# mount -avt nonfs,noproc,nosmbfs
# cd /etc
# vi passwd
# vi shadow
(If the second data field in /etc/passwd is x for every username, your system uses shadow passwords, and
you must edit /etc/shadow.) To disable the root password, edit the second data field in the password file so
that it is empty. Now the system can be rebooted and you can log on as root without a password. When
booting into runlevel 1, Debian (at least after Potato) requires a password, which some older distributions
did not.
It is a good idea to have a minimal editor in /bin/ in case /usr/ is not accessible.Also consider installing the
sash package. When the system becomes unbootable, execute
boot: Linux init=/bin/sash
sash serves as an interactive substitute for sh even when /bin/sh is unusable. Its statically linked, and
includes many standard utilities as built-ins.
Solution 2
Boot from any emergency boot/root disk set. 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
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.
==============

You might also like