Monday, 9 August 2010

Locked out of Ubuntu?

You may be faced with a situation similar to one in which I found myself, in which case here's the story of my escapade. I recently dug up an old laptop which had Ubuntu installed on it, and I had no idea what I set up as the password for my user account on the system. Before formatting the entire hard drive, I wanted to check if I had any valuable data on the hard drive, so my options were:

- Slave the IDE hard drive on a system that can read ext3
- Use a linux boot CD to see if I could mount the hard drive
- Attempt to boot into bash as root

I chose to go for the option as it was the easiest to do, without having to get up from my seat :)

---------------------------------------------------------------------------------------------------------------------------------------- Note:
By default, Ubuntu installs a recovery mode in the GRUB menu, if thats there, then you can enter the recovery console (which puts you as the root user) and use the passwd command to change any users password.

----------------------------------------------------------------------------------------------------------------------------------------

Unfortunately I didnt have that option as I took it out as a security measure. Little know to some people is that the grub boot menu can be edited in most cases by pressing 'e' whilst the menu is showing. (You may need to press the escape key to enable this feature.

So highlight the kernal you want to edit, and press 'e', highlight the line that begins with the word kernal and press 'e' again.


Now you need to edit the end of this line and delete the 'ro quiet splash' part and replace it with 'rw init=/bin/bash'. This will boot the kernal straight into bash as root.


Save this by pressing escape and it should take you back to the previous screen. Press 'b' to boot into the kernal, for which you have just edited the settings for.

From here you should be logged into a shell with root access. To change any users password, simply use the passwd command.

passwd [username]

And you have regained control of your account again. Don't forget to change the boot settings back to what they were.

Happy hacking :)

Monday, 21 June 2010

Introductory post

“I’m 01100110 01100101 01100101 01101100 01101001 01101110 01100111 00100000 01101100 01110101 01100011 01101011 01111001 00001010.”

Welcome to my blog, this is currently a place for me to jot down any pressing ideas and for me to brainstorm anything and everything I can think up of.

To start off, I suppose a little bit of information about who I am is in order. Well here we are, meet me, my name is Husman, im a computer science graduate, I like tinkering with software and hardware. My current list of interests and projects involve playing with Linux and freeBSD, Ajax, OOP languages like Java, C/C++ and python, 3D graphics, web based programming, databases and astro physics. (Ok, the part about the astro physics isn't entirely true).

I'll be putting up some more information on any projects I take part in, and document what I did, in the hopes that you'll find it interesting or of some use. With that said, I think its enough for the first post.

This is me, signing off.