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 11-05-2019, 11:09 AM   #1
cmhuggins
LQ Newbie
 
Registered: Oct 2019
Location: Arlington, TX
Distribution: Linux From Scratch
Posts: 6

Rep: Reputation: Disabled
su: Permission Denied as root


I have finished my current build using the SVN checkout of the book, adding Linux-PAM and CrackLib to my system (yes, I have rebuilt shadow and systemd). Following the directions provided by the SVN BLFS book, running `su - <username>`, all I get is `su: Permission denied` when running it as root. My /etc/pam.d/su is as it looks in the book (provided below). I am currently chrooting into the system with the command provided by the LFS book. Is there a bug that I am unaware of, or did I miss something that should've been painfully obvious?

EDIT: Adding root to the 'wheel' group does not change it
EDIT2: Using shadow NOT compiled with PAM does work

/etc/pam.d/su:
Code:
# Begin /etc/pam.d/su

# always allow root
auth      sufficient  pam_rootok.so

# Allow users in the wheel group to execute su without a password
# disabled by default
#auth      sufficient  pam_wheel.so trust use_uid

# include system auth settings
auth      include     system-auth

# limit su to users in the wheel group
auth      required    pam_wheel.so use_uid

# include system account settings
account   include     system-account

# Set default environment variables for the service user
session   required    pam_env.so

# include system session settings
session   include     system-session

# End /etc/pam.d/su

Last edited by cmhuggins; 11-05-2019 at 11:39 AM.
 
Old 11-05-2019, 02:26 PM   #2
/dev/random
Member
 
Registered: Aug 2012
Location: Ontario, Canada
Distribution: Slackware 14.2, LFS-current, NetBSD 6.1.3, OpenIndiana
Posts: 319

Rep: Reputation: 112Reputation: 112
Quote:
Originally Posted by cmhuggins View Post
I have finished my current build using the SVN checkout of the book, adding Linux-PAM and CrackLib to my system (yes, I have rebuilt shadow and systemd). Following the directions provided by the SVN BLFS book, running `su - <username>`, all I get is `su: Permission denied` when running it as root. My /etc/pam.d/su is as it looks in the book (provided below). I am currently chrooting into the system with the command provided by the LFS book. Is there a bug that I am unaware of, or did I miss something that should've been painfully obvious?

EDIT: Adding root to the 'wheel' group does not change it
EDIT2: Using shadow NOT compiled with PAM does work

/etc/pam.d/su:
Code:
# Begin /etc/pam.d/su

# always allow root
auth      sufficient  pam_rootok.so

# Allow users in the wheel group to execute su without a password
# disabled by default
#auth      sufficient  pam_wheel.so trust use_uid

# include system auth settings
auth      include     system-auth

# limit su to users in the wheel group
auth      required    pam_wheel.so use_uid

# include system account settings
account   include     system-account

# Set default environment variables for the service user
session   required    pam_env.so

# include system session settings
session   include     system-session

# End /etc/pam.d/su
You are setting the default environment variables to nothing, instead of reading /etc/environment
This should fix that. Also if you add root user to group wheel you need to logout for it to take effect
Code:
session       required   pam_env.so readenv=1
 
Old 11-06-2019, 08:00 AM   #3
cmhuggins
LQ Newbie
 
Registered: Oct 2019
Location: Arlington, TX
Distribution: Linux From Scratch
Posts: 6

Original Poster
Rep: Reputation: Disabled
Even with adding readenv=1 to /etc/pam.d/su, nothing has changed. I have recompiled CrackLib, Linux-PAM, and shadow (just to make sure there was nothing missing in terms of deps) but to no avail. Still getting permission denied from su. I will post additional configurations when I can copy them out of my distro.

EDIT: So, I realized I was some how missing /etc/pam.d/system-session... It's almost like if you're missing a single configuration file, things don't work

Last edited by cmhuggins; 11-06-2019 at 08:10 AM.
 
Old 11-06-2019, 08:07 AM   #4
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,156

Rep: Reputation: 857Reputation: 857Reputation: 857Reputation: 857Reputation: 857Reputation: 857Reputation: 857
Silly question I know but does the user name you are trying to use actually exist?
 
Old 11-06-2019, 08:11 AM   #5
cmhuggins
LQ Newbie
 
Registered: Oct 2019
Location: Arlington, TX
Distribution: Linux From Scratch
Posts: 6

Original Poster
Rep: Reputation: Disabled
User does exist, I was missing /etc/pam.d/system-session, even though I literally copied the commands from the book...
 
  


Reply

Tags
lfs, pam, shadow



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] Execute permission set but permission denied when unlocking IronKey mdh524 Linux - Newbie 2 11-12-2015 09:36 PM
[SOLVED] Permission denied as root to a root-owned directory threevolve Ubuntu 3 06-06-2013 07:27 AM
mkdir throws Permission Denied error in a directoy even with root ownership and 777 permission surajchalukya Linux - Security 14 09-03-2012 08:34 AM
can't execute c++ binaries, "permission denied"... even though permission is 777 SerfurJ Programming 14 02-20-2009 04:50 AM
'permission denied" inspite of right permission flags on network drive anirudhvij Linux - Enterprise 8 05-22-2007 05:57 AM

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

All times are GMT -5. The time now is 09:53 AM.

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