Ubuntu usually has a locked root account with unknown password. So if that is the case you need a live CD and
- boot from it
- go to your HD (mount it if necessary)
- edit the file /etc/passwd and remove the first x on the line containing your username
Below an excerpt of the file on one of my systems (slackware)
Code:
teboho:x:1003:100:,,,:/home/teboho:/bin/bash
lboya::1004:100:,,,:/home/lboya:/bin/bash
The entries contain a number of fields seperated by colons (':'). The first field contains the username and the second field is the password field.
The first line has a user (teboho) with a password; you can see this from the x following the name. Removing the x will remove the password and will result in a line like the second one. The password will be empty.
Note:
this assumes that your system uses shadow passwords (standard setups do). If it does not, the x will actually be a longer piece of text; just remove it.