LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices


Reply
  Search this Thread
Old 07-19-2017, 02:27 PM   #1
LFS_Tester
LQ Newbie
 
Registered: Jul 2017
Posts: 5

Rep: Reputation: Disabled
LFS changing into chroot environment renders passwords useless


This has happened twice now (made a back up before the second time).

Everything goes well for LFS right up to after changing ownership of /tools to root. Then at some point After 6.1 (My guess is when entering the chroot environment), it corrupts passwords of all the users. (http://www.linuxfromscratch.org/lfs/...06/chroot.html)

I realized this because during the installation, I locked my main computer, resulting in Ubuntu also getting locked out. Prior to this point it wasn't an issue as I was able to log back in and continue. However after entering the chroot environment, none of the passwords for root, myusername, or LFS work. When trying to switch accounts, the ubuntu VM screen goes black and keeps flipping screen size (all the time showing black). Rebooting also does not fix the issue as it still does not accept passwords for any of the accounts.

has anyone else faced this issue?

Edit: Password recovery
When performing a password recovery for Ubnutu, I am able to change the password of root, however when trying to change the password of any of the other user accounts, I get the message User does not exist (even though I can see the user folder in /home

Last edited by LFS_Tester; 07-19-2017 at 02:38 PM. Reason: Added recovery attempt
 
Old 07-19-2017, 03:37 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
I haven't done LFS.

However, in general a "chroot" environment is one in which you've set everything relative to another directory OUTSIDE the chroot environment. That is to say if you have put your "chroot" in say "/opt/chroot" then a user logging into chroot environment doesn't see /opt/chroot - they see "/" (root) directory and everything they need must be beneath that relative directory.

So if you have a server (non-chroot) with say /etc, /usr, /home and /opt/ subdirectories and your chroot'ed user is setup under /opt/chroot you'd need to create /opt/chroot/etc, /opt/chroot/usr, /opt/chroot/opt and so on so that when the chroot'ed user logs in he sees those as /etc, /usr, /opt and so on.

You must then copy in the files the user miight need (e.g. /usr/lib and /usr/lib64 libraries, /etc/passwd and /etc/group into those relative paths (/opt/chroot/usr/lib, /opt/chroot/usr/lib64, /opt/chroot/etc/password, /opt/chroot/etc/group and so on.

The point in a chroot directory is to make it appear to the user that he is in the main system even though he is actually in a subdirectory.
 
Old 07-29-2017, 11:30 AM   #3
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,573
Blog Entries: 19

Rep: Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452
@MensaWater In LFS you chroot to a mounted partition on which you have previously created all the static directories you will need. The dynamic ones are created by binding to the corresponding ones on your build host. The essential programs and libraries are in a special /tools directory on the new root, and /tools/bin is in your path. So you should have everything you need without having to copy anything.

I think the problem here may be due to changing the ownership of /tools to root. You're supposed to do that right at the end, after completing your build, not at the beginning of chapter 6.
 
Old 07-31-2017, 11:56 PM   #4
Rustman
LQ Newbie
 
Registered: Jul 2017
Posts: 10

Rep: Reputation: Disabled
When is the soonest you notice the issue? The passwd file is created in Section 6.6... if your chroot environment is borked so you're unintentionally altering your host passwd file instead of your chroot passwd file, that would definitely cause issues similar to what you're experiencing.
 
  


Reply

Tags
lfs, passwd, ubuntu 16.04



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] LFS 7.9 - Environment not working properly after chroot skorm513 Linux From Scratch 5 04-10-2016 07:31 AM
[SOLVED] LFS 7.2 Chapter 6.4 Chroot Environment Error raza.ajmi Linux From Scratch 11 12-14-2012 01:34 AM
[SOLVED] using a chroot environment to install software in LFS jmc1987 Linux From Scratch 4 09-23-2010 12:31 PM
Beryl renders SHIFT key useless LemmingJoel Linux - Software 3 01-20-2007 01:58 PM
Linux renders booting from floppy useless? shiny_spoon Linux - General 9 11-08-2003 03:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 09:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration