LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   password (https://www.linuxquestions.org/questions/linux-newbie-8/password-569847/)

almightyme 07-16-2007 12:25 PM

password
 
Okay I'm new at using ubuntu linux and I don't go on my computer much. I have forgotten my password is there anyway to get it back or find out what it is? Any help would be great. Thanks

pixellany 07-16-2007 01:12 PM

Boot from any "live CD" Linux. If you have a recent Ubuntu version, you may already have this. Otherwise, there are many options, including Knoppix.

Once you are running, you will need to open a terminal, find the Linux partition (on the hard drive, not the virtual partition created by the live install) which contains the /etc directory, and edit the "passwd" file. Find the line containing your user name, and remove the "x" following the first colon. The modified file will look something like this:
mherring::1001:100::/home/mherring:/bin/sh

Save the file and re-boot, and you will be able to log in with no password.

If you need more details--eg on how to find the right partition--let us know

almightyme 07-22-2007 02:30 AM

Ok so I finally found a live cd that works. And I have tried to find the right partition but I can not do it! So if someone could help me kinda step by step it would be freaking awesome. Wow I never thought it would get so manning to do something like this!!! Maybe now I will always remeber my password..lol

sycamorex 07-22-2007 03:53 AM

Can you show us the output of 'fdisk -l'?

edit: just in case you had problems:

1. Go to Applications => Accessories => terminal
2. type: sudo fdisk -l
It'll show you all your harddrives and partitions

almightyme 07-22-2007 12:22 PM

Ok I did that and I am trying to get into the linux hard drive and it keeps telling me I am unable to open it??? What do I do now?

sycamorex 07-22-2007 12:36 PM

What exactly are you doing? And what exactly does it say?

almightyme 07-22-2007 12:39 PM

I am trying to change or get my password and I type in sudo fdisk -l and it comes up with the list of my partitions. I need to get in to the first one which says /dev/hda1 So I can change my password on it. When I type in that command it says unable to open or access denied.

sycamorex 07-22-2007 12:51 PM

ok type the following:

sudo makedir temporary
sudo mount -t ext3 /dev/hda1 temporary
sudo gedit temporary/etc/passwd

it should open the file you want to modify

almightyme 07-22-2007 01:05 PM

I have to do it from a live cd. I could not log into my computer because I forgot my password. I have booted from the live cd and everything. So yea....
I typed in what you said it came up with this

ubuntu@ubuntu:~$ sudo makedir
sudo: makedir: command not found
ubuntu@ubuntu:$~ sudo makedir temporary
sudo: makedir: comand not found
ubuntu@ubuntu:$~ sudo mount -t ext3 /dev/hda1 temporary
mount: mount point temporary does not exit
so i have to get onto the linux partition from the live cd and change my password from here. I cannot get it.

Nylex 07-22-2007 01:08 PM

The command to create a directory is mkdir.

almightyme 07-22-2007 01:14 PM

okay I did that and it came up ass

ubuntu@ubuntu:$~ mkdir
mkdir: missing operand
try 'mkdir --help' for more information.

sycamorex 07-22-2007 01:18 PM

Quote:

The command to create a directory is mkdir
.

ooops, sorry:)

should be:
mkdir temporary

Nylex 07-22-2007 01:23 PM

Quote:

Originally Posted by almightyme
okay I did that and it came up ass

ubuntu@ubuntu:$~ mkdir
mkdir: missing operand
try 'mkdir --help' for more information.

You obviously need to tell it what directory you want to create..

almightyme 07-22-2007 01:28 PM

Quote:

Originally Posted by pixellany
Boot from any "live CD" Linux. If you have a recent Ubuntu version, you may already have this. Otherwise, there are many options, including Knoppix.

Once you are running, you will need to open a terminal, find the Linux partition (on the hard drive, not the virtual partition created by the live install) which contains the /etc directory, and edit the "passwd" file. Find the line containing your user name, and remove the "x" following the first colon. The modified file will look something like this:
mherring::1001:100::/home/mherring:/bin/sh

Save the file and re-boot, and you will be able to log in with no password.

If you need more details--eg on how to find the right partition--let us know

Okay so I did that now it didn't work....because I just tried to long in. So maybe I didn't do something right.


All times are GMT -5. The time now is 10:24 AM.