LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Lost username/passwd (Slackware 10.2) (https://www.linuxquestions.org/questions/linux-newbie-8/lost-username-passwd-slackware-10-2-a-389871/)

PastorFrederick 12-06-2005 12:15 PM

Lost username/passwd (Slackware 10.2)
 
I'm sure the obvious question will be: How can I reset/retrieve or delete my current username/passwd? I might remember my username, but without the right password I don't know for sure.

I printed a "walkthrough" off the net that describes minibooting, and mounting the cd so you can use vi or sed or mv to edit the shadow/passwd files. I'm going to try this, but this is just a generic paper and isn't distro specific, so I was wondering if there is an specific slackware means of getting my root back, especially since I haven't set up a usr account yet! (I haven't been on my linux partition for awhile and forgot the username and password! "Stupid" with a capital "L"!)lol.

Anyway all help is greatly appreciated, as I'm trying to learn python, and I need my linux to do so, as I don't have a windows python program.

Thanks.:Pengy:

PastorFrederick 12-06-2005 03:01 PM

Here is a link to some other information I found on the subject, as I'm having trouble getting some help here, and the search on this site seems not to work for me. Anyway someone check it out, and let me know if it is good info, as I'm going to try it later the week when I get a chance. Thanks.

http://aplawrence.com/Linux/lostlinuxpassword.html

tuxrules 12-06-2005 03:08 PM

http://linuxgazette.net/107/tomar.html

The above links says it all...Follow it verbatim and I don't think you should have a problem. Running as **root** is quite dangerous so make a regular user as soon as you can.

GrueMaster 12-06-2005 03:11 PM

One way is to boot into single user mode (if you haven't locked that function down). Iv you are using lilo, at the boot prompt, hit tab for a list of boot kernels (usually Linux is the default). Then type "Linux single" (substitute "Linux" with your normal boot kernel from the list). If you haven't locked out single user mode, this will drop you directly into a minimal shell prompt with no networking and no password prompt.

Next, edit /etc/shadow with an easy to use editor (I recommend vi, but that's a personal preference). In the editor, delete the encrypted password entry. The line will look like this:
root:$1$dL7vHy5c$R/2.bXWZDErReecKGlmQW1:13103:0:99999:7:::
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This is the password section (after the root: )

Delete everything between the colons, save and exit. Then, type chpasswd to change the password. Type exit and your system should either reboot, or start running your services for the default runlevel, ending back at a login prompt.

If your system is locked down from using single user mode, you will need a rescue boot disk. This is a completely self contained OS image, and can mount your drive as an editable auxilary drive, allowing you to edit the /etc/shadow file as I suggested earlier (the paths will of course be different). If you don't have a boot disk, you can download one of multibple types, from a floppy based image (Damn Small Linux, Puppy Linux), to a full CD (Knoppix, etc). There are images available for booting from a USB "Thumb" drive as well.

PastorFrederick 12-23-2005 08:01 AM

You are all going to laugh at this!

First of all. Thank you guys for you help it was great!

Ok, remember I said I forgot my "USERNAME" AND "PASSWORD"? Well if we would all remember linux doesn't really use "usernames" it uses accounts....I was trying to get into the root account and forgot my "username"! Well, those who understand what I'm saying are probably doubled over laughing at me, I did when I figured it out.

I followed a single user boot up walkthrough, and had to put my root password in, which I tried and it worked, so that wasn't what I had forgotten. Obviously it was the "username" (cue laughter). Anyway after much work trying to changed the password file and the shadow file, which I did, I still couldn't remember my "username" (cue laughter again), and you can't change that in said files.

So...I did the next best thing and reformated and reinstalled!!!! Well, when they asked me to login to root, and asked for my login and password it dawned on me that I need to type "root" for the username login (cue laughter ....), and my password....


lololololol
Anyway that is what happens to a newbie who doesn't use linux for a few weeks! Feel free to tell all your linux junkie friends. At least it will be good for a laugh!

:newbie:

GrueMaster 12-23-2005 09:15 AM

ROTFLMAO! :D That's great!


Don't sweat it, though. I'm sure even the most experienced of us on this board have had their cases of mental lapse. I know I have.

My biggest worry about Linux taking over the desktop? Those damn "Video Expert" commercials (I can just see some twit on TV grinning like she just messed her diaper, saying "I did the Firefox, it was really good").


All times are GMT -5. The time now is 05:36 PM.