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
|