Root password on Ubuntu
Hi,
I have a Ubuntu server box installed by someone i know and only a root user is created on it. He nearly showed me the root password by showing the keyboard but im not able login. I own the box but cant reach the person who installed so i need to find /hack/change etc the password. I did on some Fedora boxes for a long time but cant remember how to on Ubuntu. |
You just need to boot your system from a boot disk, like a USB stick or distro CD/DVD.
Once you get to a console, mount your usual root file system to /mnt Then, edit /mnt/etc/shadow Delete the hash of root's password. Then, reboot and you should be able to log in as root with no password. |
Thanks for the answer i sometimes forget this simple thing. I have booted the server with the Knoppix 5.1.1 CD, but it couldnt find and mount the harddisk of the server, though it found and automaticly founded and mount the usb stick. I opened the Qparted and saw there /dev/cciss/c0d0 ...d1 ..d2 etc entiries . So i made a directory called disk with mkdir and used mount /dev/dev/cciss/c0d0,1,2,3 whatever to /mnt/disk but it always said that there is no such device. Its HP server box , so how can i find the root parition and mount it?
|
If the boot process is via grub, you should be able to interrupt the process at the menu, hit escape to edit, select the entry you'd normally boot, hit e to edit, add "single" without the quotes at the end of the kernel line, then b to boot.
That should drop you in the shell and allow you to edit shadow. I haven't tried it on Ubuntu though, so no guarantee. Keys from memory too!!! |
try first:
sudo -s passwd or sudo passwd root edit- I just realized there is only the root account this will not work of course -/edit |
If you can boot into single-user mode, all you have to do is enter "passwd root".
Surprising to see a Ubuntu system with ONLY a root account. They normally start with an "Alpha user" who has full admin privileges, and NO root account. If the alpha user tries to do something, they are asked for THEIR password and not root's. |
Quote:
The easiest way I can think of to figure it out is to open the device with cfdisk and figure out which one it is by the size of the partition. |
If you use sudo to gain root privileges, and do not have the root account enabled (which is not recommended in Ubuntu anyway), then here is how to reset your password:
http://www.psychocats.net/ubuntu/resetpassword |
Hi,
I still have a problem to get my passwords right, here is my problem: My laptop is Dell Inspiron Mini (this means no CD, floppy, etc. and I have no external HDD). Ubuntu automatically logs in with user account (user1). During installation password was entered but not remembered and now I can not recall it. It would be no problem to do password reset with recovery mode, but I can not access GRUB. After computer start screen, I see MBR letters flashing and after that Ubuntu splash screen appears loading system. If I press ESC in any other moment before Ubuntu loading I have this on screen: "MBR 2FA:" (pressing 1 at this moment enters system testing mode). I need help with solutions I can think of: 1. How can I find what is the password of User1 (I am already logged in). I think it should be easiest way, but I dont know where to look. 2. How can I set up GRUB to make it accessible on boot? Actually, is it GRUB or other boot loader, how can I check? 3. Any other way? Re-install is very problematic and I hope to avoid it :) Thanks in advance. |
Quote:
Quote:
To make the grub menu visible when you boot, open /boot/grub/menu.lst using gedit text editor with gksudo like this: Code:
gksudo gedit /boot/grub/menu.lst Code:
## hiddenmenu http://members.iinet.net.au/~herman5...ml#hidethemenu Also, right above the hiddenmenu section there is the timeout section: Quote:
Then boot Ubuntu and select recovery mode from the grub menu and reset the super user password as per this article: http://www.psychocats.net/ubuntu/resetpassword To edit menu.lst you will need sudo privileges, which requires the password. If you are asked for the root password when you run gksudo gedit and don't know it, this will be a problem. In that case boot from a live CD, mount your Ubuntu partition and cd into /mnt/boot/grub/ and edit menu.lst, Then reboot into recovery mode. |
Thanks for reply.
1. I get it. About GRUB you are hundred percent right. I can open /boot/grub/menu.lst and see that timeout is 0 and hiddenmenu is on. That is why I do not see menu. Unfortunately, I am asked for 'your' password , which I do know and I am unable to edit this file. This 'your' password is only user1 password or you can enter root password as well (if it is enabled)? How can I check if root is enabled or not? I have no CD drive or other device), but biggest stick I have at the moment is 256 MB, is there any option how can I boot from such small stick and than mount Ubuntu partition and edit this file? |
Quote:
Quote:
http://unetbootin.sourceforge.net/ A 256mb usb stick is not big enough for Ubuntu. UNetbootin supports a number of mini distros like Puppy, DSL, and SliTaz. All of those should fit on the 256mb usb stick. |
All times are GMT -5. The time now is 12:15 AM. |