LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices

Closed Thread
 
Search this Thread
Old 07-21-2010, 08:02 PM   #1
phillipewu
LQ Newbie
 
Registered: Jul 2010
Posts: 3

Rep: Reputation: 0
PAM Authentication failure


Hi,

I am using the PAM su example from the free bsd site and when run
produces 'authentication failure' (PAM_AUTH_ERR=7)
I am running this on Redhat.


Can someone see why? Any ideas of how I can home in on the problem.
Thanks.


======================================================================
This is the run:
host myhost user testu tty /dev/pts/0
Password:
Sorry
Authentication failure
I have put the correct password for testu.


This is the key parts of the program:
/* initialize PAM */
pamc.conv = &misc_conv;
pam_start("su", user, &pamc, &pamh);


/* set some items */
if (strlen(hostname)==0) gethostname(hostname,
sizeof(hostname));
if (user==0) getlogin();
tty = ttyname(STDERR_FILENO);


if ((pam_err = pam_set_item(pamh, PAM_RHOST, hostname)) !=
PAM_SUCCESS)
goto pamerr;
if ((pam_err = pam_set_item(pamh, PAM_RUSER, user)) !=
PAM_SUCCESS)
goto pamerr;
if ((pam_err = pam_set_item(pamh, PAM_TTY, tty)) !=
PAM_SUCCESS)
goto pamerr;
printf("host %s user %s tty %s\n",hostname,user,tty);
/* authenticate the applicant */
if ((pam_err = pam_authenticate(pamh, 0)) != PAM_SUCCESS) {
goto pamerr;
}
I have checked that hostname, user, tty and password have valid values
 
Old 07-22-2010, 02:06 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,670
Blog Entries: 54

Rep: Reputation: 2953Reputation: 2953Reputation: 2953Reputation: 2953Reputation: 2953Reputation: 2953Reputation: 2953Reputation: 2953Reputation: 2953Reputation: 2953Reputation: 2953
Please post your thread once and in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate of http://www.linuxquestions.org/questi...ptions-820104/.

While your first thread yet goes unanswered that is not a valid reason for crossposting, so please don't.
 
  


Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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] Cronjob: Could not authenticate PAM user ... Authentication failure (for root?!?) JZL240I-U Linux - Security 4 10-28-2013 03:42 AM
PAM authentication failure capibolso Linux - Newbie 1 05-01-2013 04:24 AM
PAM application returns 'authentication failure' Options phillipewu Programming 0 07-16-2010 12:10 AM
PAM User Login Authentication Failure robeb Linux - Security 5 11-16-2002 09:01 PM
NIS and pam/gdm authentication failure cquense Linux - Networking 0 07-05-2001 04:08 AM


All times are GMT -5. The time now is 05:41 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration