Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Security
User Name
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.


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

Rep: Reputation: 0
PAM Authentication failure


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.

This is the run:
host myhost user testu tty /dev/pts/0
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,
if (user==0) getlogin();
tty = ttyname(STDERR_FILENO);

if ((pam_err = pam_set_item(pamh, PAM_RHOST, hostname)) !=
goto pamerr;
if ((pam_err = pam_set_item(pamh, PAM_RUSER, user)) !=
goto pamerr;
if ((pam_err = pam_set_item(pamh, PAM_TTY, tty)) !=
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
Registered: May 2001
Posts: 29,360
Blog Entries: 55

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

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 > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 12:00 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration