LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How do I reset username and password? (in Linux Kernel 2.4.26) (https://www.linuxquestions.org/questions/linux-newbie-8/how-do-i-reset-username-and-password-in-linux-kernel-2-4-26-a-744426/)

mahird 08-01-2009 05:56 PM

How do I reset username and password? (in Linux Kernel 2.4.26)
 
I bought an older Laptop for my son. It has Pentium 133mhz (yes, it is old). It came with Linux. My son wants to keep the Linux. When I turn it on, it is going through bunch of stuff that I am not familiar with. And, it stops at 'box login:'. I don't know what to enter at this point. A random entry is resulting prompt 'Password:'. Is there any way to reset these? Do I need to reinstall Linux. I noticed following also (if helps):

LILO 22.5.7.2

I also noticed the following during start up:

Linux Kernerl 2.4.26

Thanks for any help.

Oldlaptop321 08-01-2009 06:10 PM

You may well want to reinstall Linux, as that sounds like a rather old distribution. However, there are several ways to reset this, if you do not mind messing with some configuration files. Could you give me any more details about the system? The Linux distribution you are running would be especially helpful.

mahird 08-01-2009 06:27 PM

Quote:

Originally Posted by Oldlaptop321 (Post 3628018)
You may well want to reinstall Linux, as that sounds like a rather old distribution. However, there are several ways to reset this, if you do not mind messing with some configuration files. Could you give me any more details about the system? The Linux distribution you are running would be especially helpful.

Yes, I would like to reinstall Linux. Is it still free? How do I go about getting the software?

jschiwal 08-01-2009 06:40 PM

You may have been jotting down parts of some bootup messages. The numbers you noted are the version numbers. But since you get to the log screen, it sounds like it is booting OK. You just need to zero out the passwords temporarily so you can log in.

Normally, I would recommend wiping the hard drive and installing a fresh distro after buying a used machine. However given the age of this laptop, finding a light enough distribution may take some work.

At the initial boot menu, is there a "Rescue" menu item? If not try entering "rescue" in the line with boot options (probably at the bottom of the screen). It sounds like you forgot the usernames & passwords, and need to edit a file to temporarily reset them. Another option is booting from the install disc for the distro and entering "rescue" on it's boot options line. If you have a live distro, such as knoppix, you can boot the machine up to that.

Post back and we can tell you how to find the user names and edit the /etc/passwd file to allow you to log in.

Good Luck!

RaptorX 08-01-2009 07:08 PM

On a machine that old Slax is one of the linux distributions that would work like a charm (there are some others like Damn Small Linux but Slax is friendlier). It is relatively small, is fast and it is Free as most Linux distros.

With a usb or CD-rom you would be able to boot Slax in to that computer and decide wether to stick with Slax (you dont even need to install if you dont want to) or even use it to reset the password of the Linux that is in the laptop installed.

http://www.slax.org/ is where you can download it if interested.

In my opinion that is the easiest way to go in this situation.

Oldlaptop321 08-02-2009 08:11 AM

Quote:

Originally Posted by mahird (Post 3628025)
Yes, I would like to reinstall Linux. Is it still free? How do I go about getting the software?

Yes, of course it is free. As they have said above however, you might have trouble finding a kind of Linux that will run easily on something that old. If you do not mind a rather unfriendly user interface, you could get, say, openSUSE or Debian and pick the Minimal with X11, this will give you a very light GUI that is almost guaranteed to run, but this would not be a very nice-looking desktop. Whatever you do, do not try to run anything on it that says it uses KDE4, which is a very nice looking desktop, but probably will not work too well on something that old. KDE 3.5 and older should work okay. http://www.linux.com, http://www.linux.org, or LinuxQuestions' own review section, http://www.linuxquestions.org/reviews/ may help in finding a kind of Linux for your needs.

vonbiber 08-02-2009 09:26 AM

you could
1. keep the linux that's already installed
in which case you should ask your son about the password
for root
then you login as root and create a new user

yes, there's a way to reset the password
if you have a floppy drive, you can create a rescue disk
you can download one from here
http://www.toms.net/rb/

then boot from the floppy, mount the partition where linux is
located and cd on that partition to the etc directory
there's a file named
passwd
check if there's a file named
shadow
if the answer is yes the file you need to edit is shadow, otherwise
it's passwd

open the file with an editor (vi, for instance) and go to the
line that starts with
root:....:

copy that line below, and precede the original with '#', so that now
it is like this
#root:....:...
root:....:...

the (encrypted) password is all what's between the first
colon ':' (after root) and the next colon
remove all the characters between these two ':' in your second root line
afterwards it should look like

#root:c03m900...:...
root::...

save and exit

then cd to the floppy, umount the partition, reboot (remove the floppy)
at the login prompt type after your typed in 'root' you shouldn't be
prompted for a password

Now you can set a new password with the command

passwd


2. if you prefer to install a new linux you might get
a more recent linux than the one installed but not
too new, especially if you want a graphical interface
you can try
slackware and select xfce as the window manager (kde might not
work on your laptop if you don't have enough RAM)

if you want to try out slax (as suggested below) the more
recent ones won't probably work (they use kde and require
at least 256MB of RAM) you can try the versions 5.something
that have xfce

RaptorX 08-02-2009 09:59 AM

Quote:

Originally Posted by vonbiber (Post 3628418)
you could
1. keep the linux that's already installed
in which case you should ask your son about the password
for root
then you login as root and create a new user

I guess that would not work since he bought the laptop for his son... so both know nothing about the pass... :)

vonbiber 08-02-2009 11:05 AM

Quote:

Originally Posted by RaptorX (Post 3628442)
I guess that would not work since he bought the laptop for his son... so both know nothing about the pass... :)

my mistake
I thought 'bought the laptop' FROM 'his son'
should have read more carefully

well, in this case they'll have to remove the old password
in /etc/shadow (if it exists, otherwise in /etc/passwd), reboot
and reset the root password

Oldlaptop321 08-02-2009 02:43 PM

Another thing that comes to mind is booting into runlevel 1, on some distros it will let you log in as root without a password, at which point you can create a new account or reset the password for any existing accounts with useradd or passwd, respectively.


All times are GMT -5. The time now is 11:19 PM.