LinuxQuestions.org
Visit Jeremy's Blog.
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 01-16-2015, 01:28 PM   #1
flesh75
LQ Newbie
 
Registered: May 2002
Location: Canada
Distribution: Debian
Posts: 11

Rep: Reputation: 0
login always fails after first failed attempt, libgcrypt warning


Some notes first, may be related to the problem
- I am using PAM
- libgcrypt displays a warning about not being initialized by login


Why does login always fail after a first failed attempt ?
 
Old 01-16-2015, 05:07 PM   #2
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
Which build of B/LFS are you using, are you using the book defaults, and did you rebuild shadow and cracklib for PAM support?
 
Old 01-16-2015, 09:43 PM   #3
flesh75
LQ Newbie
 
Registered: May 2002
Location: Canada
Distribution: Debian
Posts: 11

Original Poster
Rep: Reputation: 0
I am using LFS 7.5. I followed the book but added some packages from BLFS. I rebuilt libcrack and shadow using PAM. My /etc/pam.d/login file looks like :


# Begin /etc/pam.d/login

# Set failure delay before next prompt to 3 seconds
auth optional pam_faildelay.so delay=3000000

# Check to make sure that the user is allowed to login
auth requisite pam_nologin.so

# Check to make sure that root is allowed to login
# Disabled by default. You will need to create /etc/securetty
# file for this module to function. See man 5 securetty.
#auth required pam_securetty.so

# Additional group memberships - disabled by default
#auth optional pam_group.so

# include the default auth settings
auth include system-auth

# check access for the user
account required pam_access.so

# include the default account settings
account include system-account

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

# Set resource limits for the user
session required pam_limits.so

# Display date of last login - Disabled by default
session optional pam_lastlog.so

# Display the message of the day - Disabled by default
session optional pam_motd.so

# Check user's mail - Disabled by default
#session optional pam_mail.so standard quiet

# include the default session and password settings
session include system-session
password include system-password

# End /etc/pam.d/login
 
Old 01-16-2015, 10:34 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
One of many reasons I refuse to use PAM...

Are you trying to login as root or as a specific user?
 
Old 01-16-2015, 10:49 PM   #5
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
You should see syslog messages. It outputs some meaningful messages so we can diagnose what's wrong. Also check your /etc/pam.d/*files. They may give exact reason for problem. Also read pam user guide available from same site you downloaded libPAM.
 
Old 01-16-2015, 10:56 PM   #6
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
The PAM user guide is thorough but equally misleading and confusing as to what you might need.

The BLFS defaults are what you need to start from first, but first figuring out what account he's logging in from first is where we need to start from.
 
Old 01-17-2015, 08:23 AM   #7
flesh75
LQ Newbie
 
Registered: May 2002
Location: Canada
Distribution: Debian
Posts: 11

Original Poster
Rep: Reputation: 0
The username I use does not matter. It always behaves this way.
 
Old 01-17-2015, 05:33 PM   #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
Hmmm... Okay let's try this. Start at the PAM section and redraft all of the configuration files for PAM, shadow, and any other BLFS packages that utilize PAM, and maybe even rebuild a few of the packages as needed. If this works, this should restore PAM back to a default setting for B/LFS.

Rebuild libgcrypt and reinstall it. Or see if an update is available in the latest book. Rebuild PAM if needed also.

Find your host's /etc/securetty file and copy it to /etc on your B/LFS partition. In the login configuration, enable the root login feature. Try logging in.

On your primary user account, try adding it to the wheel group. If you have sudo installed, make sure you set sudo's configuration as needed.

Reconfigure any usage of modules to use pam_unix.so. This is a universal access module and should allow unimpeded operation of packages. Use with care though and do this only for diagnostic purposes.

If all else fails, you may need to go back and remove PAM and rebuild any components using it to work without PAM and find out what happened. If you saved your preconfigured and cleaned sources this will help.

If from here you are at a loss, try asking on the BLFS mailing list. I don't use PAM myself as I often find it to be an annoyance that's better left out.
 
  


Reply

Tags
login



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] Send mail on failed attempt to login milljunky Linux - Security 2 06-03-2012 12:09 PM
ssh warning POSSIBLE BREAK-IN ATTEMPT z01krh Linux - Newbie 6 02-28-2012 11:24 PM
Make computer shutdown on failed login attempt? Canadian1296 Linux - Security 2 11-21-2011 12:03 AM
Block IP after failed login attempt using iptables? FireRaven Linux - Security 6 08-11-2009 12:33 PM
every attempt has failed ed_norton Linux - Newbie 3 04-03-2004 04:59 PM

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

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