Syed Jahanzaib Personal Blog to Share Knowledge !

December 2, 2011

Ubuntu Howto change ROOT password after fresh installation

Filed under: Linux Related — Tags: , , — Syed Jahanzaib / Pinochio~:) @ 11:12 AM

Howto change ROOT password in Ubuntu (All variants)

When you install fresh Ubuntu, you can login via normal user account which do not have root/admin rights. So when you try to change to super user root , you just can’t Login to root because you don’t have the root Password. Although you can use sudo command (which is also a kind of failsafe to prevent accidently execution of unwanted mistakes or commands) to execute any task that requires root access, but still if you are doing some administrative related work, its a bit annoying to use sudo before every command.

In Ubuntu , root ID is created without predefined password, it does not have a password, but it does not have an empty password either , ggrrrrrrr

To assign/change  root password , use the following command at terminal

sudo passwd root


It will ask you to enter current user password, enter it and then it will ask you to enter new root password two times, then it will change the root password , then simply log off and login with root id or use


It will ask you to enter root password, simply enter password that you set in above step.


… OR …

Alternate method is following …

Use below command to switch to shell world

sudo sh

It will ask you the default current user password, just enter your password and press Enter and you will be presented with # sign.

Now enter this command to change the root password.

passwd root

Now enter your new password for user root twice and now you can login to root by using your newly created password by using . . .

su root



Howto Recover User Forgotten Password  [ UBUNTU  12.x ]

1. Reboot your ubuntu computer
2. Hold shift during boot to start GRUB menu
3. Highlight your image and press ‘e’ to edit
4. Find the line starting with linux and append init=/bin/bash at the end of that line
5. Press ctrl-x to boot.
6. Type in passwd username
7. Set your password.
8. Type in reboot



Syed Jahanzaib

1 Comment »

  1. Thank you. It’s good to have important info like this floating around the internet.

    Comment by blaineiwood — January 4, 2012 @ 6:22 AM

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at

%d bloggers like this: