Are you saying you've forgotten your username and password? If so, this might help:
http://cities.lk.net/lost_password.htm
Code:
0. Some newsgroups letters
1. Boot your miniroot
2. Mount the disk
3. What your need to edit
4. How to do by sed
5. How to do dy by other username
0. Some newsgroups letters.
See, for example, the letters on the Dejanews:
It really has happened.
Really exposes a security hole.
Root password stupidity problem!
Every day fetchs many poor users forgot the password.
It may be found a few thousands letters on this subject.
1. Boot your miniroot
Boot your miniroot by diskets bootdisk and rootdisk.
If you haven't these diskets you can try download they from
Sources for distribution bootdisks (Slackware, Redhat or Debian mirrors).
Download these image disks on your Windows ( or whatever ) hard disk
and after that you can create these two diskets by program rawrite.
If you haven't this program you can also download it here with source and docs.
It maybe, that this diskets don't contain configuration you computer need.
Then configure these diskets by distributive Linux CD.
See HOWTO by Tom Fawcett and Graham Chapman for more details
about boot and root disks.
Boot and Root disks
Bootdisks and the boot process.
2. Mount the disk.
Mount your Linux disk to mountpoint, for example /mnt
mount /mnt /dev/hdb3
Now you can go to the mounted disk
cd /mnt
Search there one of well known Unix utilities vi or sed or mv.
The best way to use vi. But maybe you can't run vi due to some problems.
For example, vi uses some share libraries ( /etc/ld.so.conf )
which aren't on the mounted disk.
3. What your need to edit
Try now to edit your file /etc/passwd by vi or sed. But, attention!
Your file /etc/password is in fact /mnt/etc/passwd. You need to edit
the line contains the word "root". For example, if your /etc/passwd
contains the line
root:x3FrTg6uYT7.:0:0:root:/:/bin/sh
edit it and blank out the password field to the next:
root::0:0:root:/:/bin/sh
You should be able to login as root and you needn't any password for root.
After that, don't forget to change your root password to new one.
It maybe done by Linux utility passwd.
4. How to do by sed
If your attempt to use vi was unsuccessful, try sed.
Here there is the format of the command sed you need:
sed /^root/s/.*:root:/root::0:0:root:/ /mnt/etc/passwd
For more details about sed see
Sed, a stream editor
Getting Started with Sed
Introduction to Unix's SED editor
5. How to do by other username
So, maybe you have any other non-root username and you do remember
the corresponding password. Then you needn't vi and sed.
Reboot your Linux and login with this other username.
Copy /etc/passwd to your local directory, save it for safety, edit it.
Now reboot to miniroot by bootdisk and roodisk, mount disk
and restore your /etc/passwd file from local directory.
If all these advices doesn't help try any crack program ...