LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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, 07: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, 01:06 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
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



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 11 03-14-2019 01:05 PM
PAM authentication failure capibolso Linux - Newbie 1 05-01-2013 03:24 AM
PAM application returns 'authentication failure' Options phillipewu Programming 0 07-15-2010 11:10 PM
PAM User Login Authentication Failure robeb Linux - Security 5 11-16-2002 08:01 PM
NIS and pam/gdm authentication failure cquense Linux - Networking 0 07-05-2001 03:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

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