reset ubuntu server password

Asked by frankie mueller

New to Ubuntu. I have a web server running on a 32-bit PC machine. I believe it is running Ubuntu Server 9.04 (that is the disk I found). I attempted to reach the Grub screen as detailed in many posts for the desktop version. I was not successful. This is when I did further research and noted that either the Grub timeout is set to 0 or I am running a server version which doens't appear to have a Grub and the root is disabled.

I am wondering if the Ubuntu desktop version LiveCD would allow to mount the drive and access the directory where the user shadow file in order to edit the hash. If not - can anybody point me in the right direction to break into this box?

Thanks in advance

Question information

English Edit question
Ubuntu grub Edit question
No assignee Edit question
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :

You can boot livecd and mount the partition (you don't mount drives). You can then run:

gksudo nautilus

and get write access to the file. You will then need to chroot to the installed OS and run:

sudo update-grub

To apply the setting.

Revision history for this message
frankie mueller (frankie-mueller) said :

thank you actionparsnip!

So liveCD for the desktop will get me into the server partition - wonderful!

I understand mounting the partition and running the gksudo nautilus (found some instructions on that). However, I do not understand how to accomplish "need to chroot to the installed OS and run: sudo update-grub".

Revision history for this message
actionparsnip (andrew-woodhead666) said :
Revision history for this message
frankie mueller (frankie-mueller) said :

Hello Actionparsnip,

I am totally new at this - so I have done some additonal reading and looked over the article. I think I only need to do the first part to accomplish the chroot. Can you explain what the "sudo update-grub" accomplishes? It sounds to me like the grub file is replaced - this of course makes me a bit nervous. What are the affects of this action? Just trying to gather as much info as possible before I bring down this live box and try to reset the password.

Revision history for this message
delance (olivier-delance) said :

First I need to be sure you use Grub2. So could you post result of command:
    grub-install --version
0.97 or 0.98 => Grub legacy
1.97 or 1.98 => Grub2
If you use Grub2, update-grub will rebuild grub.cfg, i.e. boot file configuration from a analysis or your partition, configuration file /etc/default/grub and configuration folder /etc/grub.d. If you are nervous about it, you can simply make a backup of file /boot/grub/grub.cfg and restore it if there is any problem.

Can you help with this problem?

Provide an answer of your own, or ask frankie mueller for more information if necessary.

To post a message you must log in.