LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 06-08-2014, 07:58 AM   #1
kamils096
Member
 
Registered: May 2014
Posts: 60

Rep: Reputation: Disabled
[BLFS7.5]passwd - Permission Denied - even if i'am root


Hello again, i have a little problem again. I install Linux-PAM and reinstall Shadow and i copied configuration from book. Everything is fine, but i have a problem - i can't use passwd. When i try to use passwd(even if i'm root) i get a message:
Code:
passwd: Premission denied
passwd: password unchanged
I can't change root password and other users password. When i login to another user, and try to change own passwod i get same error. I suspect LinuxPAM or Shadow configuration, because before everything was fine. How i can solve this problem?

Last edited by kamils096; 06-17-2014 at 12:00 PM.
 
Old 06-08-2014, 10:16 AM   #2
corbis_demon
Member
 
Registered: Jun 2004
Distribution: CLFS
Posts: 523

Rep: Reputation: 38
Can you go to a virtual console (tty1...) and log in from there?
 
Old 06-10-2014, 01:14 PM   #3
kamils096
Member
 
Registered: May 2014
Posts: 60

Original Poster
Rep: Reputation: Disabled
Yes, i can login without problems, but i can't use passwd.
 
Old 06-10-2014, 03:14 PM   #4
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,558
Blog Entries: 15

Rep: Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097
1. When you re-installed shadow did you use the LFS instructions or the BLFS extended instructions that include the PAM configuration?

2. Did you install cracklib prior to installing PAM?

To be honest, I rarely touch PAM in my builds due to the fact that if it screws up, you can get locked out rather easily, even from root.

My questions, why are you installing PAM? How will PAM meet your needs? What are the goals you seek to accomplish with PAM in the long term?
 
Old 06-11-2014, 05:50 AM   #5
kamils096
Member
 
Registered: May 2014
Posts: 60

Original Poster
Rep: Reputation: Disabled
I compile LinuxPAM(i haven't cracklib) and i recompile Shadow. I copy configuration from book(of course i include PAM in configuration), everything is ok, so this is problem with /etc/pam.d/passwd file.
 
Old 06-12-2014, 12:26 AM   #6
corbis_demon
Member
 
Registered: Jun 2004
Distribution: CLFS
Posts: 523

Rep: Reputation: 38
Are you using the sample configs from the BLFS "Shadow-4.1.5.1" package?
 
Old 06-12-2014, 03:30 AM   #7
kamils096
Member
 
Registered: May 2014
Posts: 60

Original Poster
Rep: Reputation: Disabled
Yes, i use sample configuration, i check configuration again, but i'm sure it's ok.
 
Old 06-12-2014, 03:48 AM   #8
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,558
Blog Entries: 15

Rep: Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097
Since you didn't use cracklib, is this your /etc/pam.d/passwd file?

Code:
cat > /etc/pam.d/passwd << "EOF"
# Begin /etc/pam.d/passwd

password  include     system-password

# End /etc/pam.d/passwd
EOF
Do note that the BLFS book has this also for system-password...

Without Cracklib
Code:
cat > /etc/pam.d/system-password << "EOF"
# Begin /etc/pam.d/system-password

# use sha512 hash for encryption, use shadow, and try to use any previously
# defined authentication token (chosen password) set by any prior module
password  required    pam_unix.so       sha512 shadow try_first_pass

# End /etc/pam.d/system-password
EOF
With Cracklib
Code:
cat > /etc/pam.d/system-password << "EOF"
# Begin /etc/pam.d/system-password

# check new passwords for strength (man pam_cracklib)
password  required    pam_cracklib.so   type=Linux retry=3 difok=5 \
                                        difignore=23 minlen=9 dcredit=1 \
                                        ucredit=1 lcredit=1 ocredit=1 \
                                        dictpath=/lib/cracklib/pw_dict
# use sha512 hash for encryption, use shadow, and use the
# authentication token (chosen password) set by pam_cracklib
# above (or any previous modules)
password  required    pam_unix.so       sha512 shadow use_authtok

# End /etc/pam.d/system-password
EOF
If you set the wrong one it may have locked you out.
 
1 members found this post helpful.
Old 06-17-2014, 11:58 AM   #9
kamils096
Member
 
Registered: May 2014
Posts: 60

Original Poster
Rep: Reputation: Disabled
Well, problem is solved, i have wrong name of system-password file. Very thanks for help.
 
  


Reply



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] Permission denied as root to a root-owned directory threevolve Ubuntu 3 06-06-2013 07:27 AM
LDAP removed, passwd: permission denied nexusdk Linux - Security 4 02-26-2013 07:14 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
Permission denied as root for /etc/passwd ltoni Linux - Newbie 6 04-18-2012 12:30 PM
./ permission denied even as root lonecrow Linux - Software 4 08-23-2006 08:29 PM

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

All times are GMT -5. The time now is 08:54 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