LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   forgot my lfs system password..what to do now? (https://www.linuxquestions.org/questions/linux-from-scratch-13/forgot-my-lfs-system-password-what-to-do-now-769370/)

akkikaushik 11-15-2009 10:36 PM

forgot my lfs system password..what to do now?
 
i made lfs system it was working well..i tried to login after 6 months ..but the problem is that i forgot my password..what should be done now to loggin.
is there anyway to login?
will this lfs system work again?
plz help!!!!!

anomie 11-15-2009 11:24 PM

I don't know LFS, but if you are using grub (and you probably are), you can simply pass an 'S' kernel option in to get to single-user mode. Reset root's password from there.

If you've set a grub password, and don't know that either, then you're going to need a live cd to do the job.

akkik 11-22-2009 12:48 AM

live cd details
 
from where can i buy live cd.
can i purchase already build lfs system.,if yes then from where and how?

catkin 11-22-2009 12:58 AM

Quote:

Originally Posted by akkik (Post 3765419)
from where can i buy live cd.
can i purchase already build lfs system.,if yes then from where and how?

Please start your own thread. It is confusing when there is more than one subject in a thread. For your question it will help if you say which country you are in.

EricTRA 11-22-2009 12:58 AM

Hello,

You can download any LiveCD from the internet, there's no real need to buy one. Then you can boot from the LiveCD and chroot into the harddisk environment and change the root password. Next, reboot and voila, up and running.

Once booted from LiveCD do this:
Code:

mkdir /mnt/tmp
mount /mnt/tmp /dev/sda1              <<< the partition that contains your LFS
mount --bind /dev /mnt/tmp/dev
mount -t proc none /mnt/tmp/proc
chroot /mnt/bin/bash

Now you've chrooted into a bash shell of your LFS system and can run
Code:

passwd
to reset the password.

Kind regards,

Eric

basan46 10-31-2014 03:39 PM

hello,
my lfs is on sda5.
i get an error /mnt/tmp is not a block device when i do mount /mnt/tmp /dev/sda5.
please help.
I am sooo close to booting my lfs.

spiky0011 10-31-2014 03:50 PM

basan46

Create a new thread pls, sorry dose this regard passwd?

basan46 10-31-2014 04:01 PM

hello,
yea i followed this procedure after i forgot my passwd and trying to follow the above steps from a live cd

spiky0011 10-31-2014 04:04 PM

Ok mount /dev/sda5 back on /mnt/lfs,
then follow the http://www.linuxfromscratch.org/lfs/...06/kernfs.html
6.2.2 and 6.2.3

then chroot in http://www.linuxfromscratch.org/lfs/...sedchroot.html

Code:

passwd root
if reseting root password

basan46 10-31-2014 04:21 PM

When I do passwd root, it tells password too short and then password changed without providing me with an option to enter my new passwd

spiky0011 10-31-2014 04:22 PM

How long was it, can you make it longer?

basan46 10-31-2014 04:28 PM

1 sec.
root:/# passwd root
Changing password for root
Enter the new password (minimum of 5 characters)
Please use a combination of upper and lower case letters and numbers.
Bad password: too short.
Warning: weak password (enter it again to use it anyway).
passwd: password changed.
root:/#

spiky0011 10-31-2014 04:33 PM

Is that defernetly your lfs install?

Before you chrooted in did you make sure "lfs" was set 1st export LFS=/mnt/lfs?

basan46 10-31-2014 04:39 PM

I followed these steps..

Mount /mnt/lfs /dev/sda5
Then all the steps in 6.2.2 and 6.2.3 which includes an export to LFS.
Then I chroot to it.
Then type passed root and I got the above output

spiky0011 10-31-2014 04:47 PM

I would umount everything again reboot, then as root on host
export LFS=/mnt/lfs echo $LFS
then follow the post #9

before changing passwd just make sure you have chrooted into lfs

basan46 10-31-2014 04:51 PM

Can u please answer with bit more details regarding umount and checking whether chrooted into LFS. Coz I really don't want to mess up more

spiky0011 10-31-2014 04:56 PM

just reboot your host system then chroot in,

In lfs / you will have a sources dir so that will be lfs

basan46 10-31-2014 04:57 PM

Now, I rebooted and set LFS and chroot. I get failed to run command usr/bin/env. No such file ore directory.

spiky0011 10-31-2014 05:10 PM

did you mount /dev/sdXX to /mnt/lfs

basan46 10-31-2014 05:14 PM

Mount /dev/sda5 /mnt/lfs right ?

spiky0011 10-31-2014 05:18 PM

yes

And echo $LFS

Keith Hedger 10-31-2014 05:24 PM

Quote:

Originally Posted by basan46 (Post 5262636)
I followed these steps..

Mount /mnt/lfs /dev/sda5
Then all the steps in 6.2.2 and 6.2.3 which includes an export to LFS.
Then I chroot to it.
Then type passed root and I got the above output

You have the mount arguments back to front it should be
Code:

mount /dev/sda5 /mnt/lfs
A good way to remember which way round they go is 'mount somthing somewhere'

basan46 10-31-2014 05:25 PM

I successfully reset the password, now I'm not able to login after boot
Login - lfs ( guessing its default, otherwise I don't remember giving a login name )
Password - the one I set now

Teufel 10-31-2014 05:26 PM

you can check whether you chrooted or not by running 'mount' command.
Just type 'mount' without any options. It will show you mounted filesystems. Check its output for string that starts with "/dev/sda5 on / type..." If you have it in 'mount' output it means you are chrooted.

basan46 10-31-2014 05:29 PM

I observed this while my previous password was set, I typed my password in the login name to check. And it was printing z instead of z.
Note - that was my previous passwd

spiky0011 10-31-2014 05:29 PM

If you can login as root now you can change lfs user passwd the same way
as root passwd lfs

"Hi Keith"

Keith Hedger 10-31-2014 05:50 PM

Hi spike didn't miss much by the looks of it

basan46 10-31-2014 06:02 PM

I still have trouble logging in..

Keith Hedger 10-31-2014 06:07 PM

Quote:

Originally Posted by basan46 (Post 5262681)
I still have trouble logging in..

What sprt of trouble? If you have npt mount ed the lfs partitipn cprrect;y because you got the args to mount back to front you may have fubar'ed somthing try again but this ttime with the correct arguments to mount, if in doubt check the man page, sorry for the bad typing i'm on my tablet, damn stupid tiny keys!

basan46 10-31-2014 06:12 PM

I successfully reset the password, now I'm not able to login after boot
Login - lfs ( guessing its default, otherwise I don't remember giving a login name )
Password - the one I set now

I observed this while my previous password was set, I typed my password in the login name to check. And it was printing z instead of z.
Note - that was my previous passwd

stoat 10-31-2014 10:01 PM

See the other thread. All is made clear there.

Teufel 11-01-2014 04:43 AM

Assuming you trying to log in as "lfs" user using root password (that one you had changed recently).
Boot your system. When you will be asked for login, type "root" and hit Enter key. Being asked for password, type the password you had changed recently. Press Enter key. If you successfully logged in, run this command:
Code:

ls -l /home
it will show content of /home directory. /home has a subdirectory matches your user name. You must use it as your user name. Let say it's name is "lfs" as you expecting it. Reset (set new password) for this user by running:
Code:

passwd lfs
Once you will change user password, type "exit" and press Enter. You will be logged out. Now log in as "lfs" user with new "lfs" user's password.


I'm wondering how did you install LFS if you even can't log in and reset password?

stoat 11-01-2014 09:33 PM

Quote:

Originally Posted by Teufel

.../home has a subdirectory matches your user name. You must use it as your user name. Let say it's name is "lfs" as you expecting it....

Just FYI, there is no regular user yet at the point where this person is working. The /home directory is completely empty at this point. A newly finished LFS system has only the root user.
Quote:

Originally Posted by Teufel

I'm wondering how did you install LFS if you even can't log in and reset password?

Except for a set of temporary compiling tools, an LFS system is built entirely in a chroot environment in a host system.

Teufel 11-02-2014 05:08 AM

Quote:

Originally Posted by stoat (Post 5263142)
Just FYI, there is no regular user yet at the point where this person is working. The /home directory is completely empty at this point. A newly finished LFS system has only the root user.
Except for a set of temporary compiling tools, an LFS system is built entirely in a chroot environment in a host system.


My assumption is he could create user account and that is why I suggested to check /home directory.
Nobody knows for sure whether he has user account or not (including OP itself since he tries to log in). Once he forgot a password he could forgot a user as well, isn't it? So ls /home is just a test for user existence.

And yes, thanks for remembering about chroot, I just forgot that my system built in the same way... :D

stoat 11-02-2014 07:38 AM

Quote:

Originally Posted by Teufel

My assumption is he could create user account and that is why I suggested to check /home directory.

You're right. He could have created a user account without mentioning it.
Quote:

Originally Posted by Teufel

Nobody knows for sure whether he has user account or not (including OP itself since he tries to log in).

In basan46's other thread on this matter (this one is a re-animated zombie-necro), it's clearer that he simply became confused and thought the "lfs" user in the host system was somehow present in the newly created LFS system.


All times are GMT -5. The time now is 07:44 PM.