Re: BLFS, After pam and systemd

Pocket ([email protected] via blfs-support Mailing List) <[email protected]>
Newsgroups gmane.linux.lfs.beyond.support
Message-ID <[email protected]>

On 8/20/26 10:38, Richard Henschel ([email protected] via 
blfs-support Mailing List) wrote:
> On 8/20/26 01:10, Pierre Labastie ([email protected] via blfs- 
> support Mailing List) wrote:
>> On Thu, 2026-08-20 at 01:57 +0000, Richard wrote:
>>> Been there, done that...
>>>
>>> In pcap install, you want to back this out:
>>>
>>> mv -v /etc/pam.d/system-auth{,.bak} &&
>>> cat > /etc/pam.d/system-auth << "EOF" &&
>>> # Begin /etc/pam.d/system-auth
>>>
>>> auth      optional    pam_cap.so
>>> EOF
>>> tail -n +3 /etc/pam.d/system-auth.bak >> /etc/pam.d/system-auth
>> I do have the modified system-auth, and it works for me...
>>
>> I cannot reproduce ATM. What I have done differently is that I have
>> built cracklib and libpwquality before shadow (cracklib even before
>> pam), and libcap-pam after systemd. I use jhalfs, so that instructions
>> should be the same as the ones obtained with "dump-commands".
>>
>> I'll try to reproduce exactly what you have done, but this may take
>> some time because I need to set up a new VM for this...
>>
>> Pierre
>>
> I tried the script for libcap-2.78, which I am pretty sure I did not do 
> in July because this was a re-install from an earlier version. This time 
> it works, so I can only assume that I had made a messed up system-auth 
> file, and unfortunately I have no record what was in it... sorry.  The 
> results were EXACTLY like what the original poster saw; i.e. logins for 
> ANY user via gdm, su or ssh did not require a password which I found 
> quite disturbing.  The final picture of system-auth at the bottom of 
> this mail here does and should work.
> 
> I tried something else just now which I may have incorrectly done at the 
> time and it does break logins (Note missing last line).  It may have 
> been the original posters mistake as well:
> 
> mv -v /etc/pam.d/system-auth{,.bak} &&
> cat > /etc/pam.d/system-auth << "EOF" &&
> # Begin /etc/pam.d/system-auth
> 
> auth      optional    pam_cap.so
> EOF
> 
> Given the date on the backup, I may not have run the script the first 
> time libcap went in.  This is what I ended up after on my attempt in 
> July and copied the *.bak file back. It matches what Linux-PAM says it 
> should be.
> 
> lfs [ /etc/pam.d ]$ ls -la system-auth*
> -rw-r--r-- 1 root root 96 Jul 19 18:17 system-auth
> -rw-r--r-- 1 root root 96 Feb 25  2025 system-auth.bak
> lfs [ /etc/pam.d ]$ cat system-auth system-auth.bak
> # Begin /etc/pam.d/system-auth
> 
> auth      required    pam_unix.so
> 
> # End /etc/pam.d/system-auth
> # Begin /etc/pam.d/system-auth
> 
> auth      required    pam_unix.so
> 
> # End /etc/pam.d/system-auth
> 
> I then ran the script and get this:
> 
> root [ /etc/pam.d ]# ls -al system-auth*
> -rw-r--r-- 1 root root 129 Aug 20 07:35 system-auth
> -rw-r--r-- 1 root root  96 Jul 19 18:17 system-auth.bak
> root [ /etc/pam.d ]# cat system-auth
> # Begin /etc/pam.d/system-auth
> 
> auth      optional    pam_cap.so
> auth      required    pam_unix.so
> 
> # End /etc/pam.d/system-auth
> 
> 


What the book has is fragile, it expects the system-auth file to be 
exactly as it expects it to be which is not always the case.

This works:

sed -e '/pam_unix.so/i auth optional pam_cap.so ' -i .bak 
/etc/pam.d/system-auth
-- 
Hindi madali ang maging ako

-- 
http://lists.linuxfromscratch.org/sympa/info/blfs-support
Unsubscribe: See the above information page
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.