Sponsored Content
Operating Systems Linux Red Hat PAM configuration: Kerberos authentication and NIS authorization problem Post 302386263 by geek.ksa on Tuesday 12th of January 2010 02:53:06 AM
Old 01-12-2010
PAM configuration: Kerberos authentication and NIS authorization problem

Hi,

I've configured two linux boxes to authenticate against Windows Active Directory using Kerberos while retrieving authorization data (uids, gids ,,,)from NIS.

The problem I ran into with my PAM configuration is that all authentication attempts succeed in order.i.e. if someone tried his NIS credentials he will be granted access!!

What I want is this: Kerberos authentication is tried first; if it fails, local files authentication ONLY is tried.

here's my PAM configuration from system-auth pam configuration file which is included by all systems pam-aware services:

Code:
auth        required      pam_env.so
auth        sufficient    pam_krb5.so debug
auth        sufficient    pam_unix.so nullok try_first_pass
auth        requisite     pam_succeed_if.so uid >= 500 quiet
auth        required      pam_deny.so

The issue here: I think the pam_unix module somehow contacts NIS for authentication if Kerberos fails. But, I had updated my sswitch.conf to look like:

Code:
passwd:     files nis
shadow:     files
group:      files nis

I thought the pam_unix.so module references this file to see where to look up passwords.

Please note that I can't remove nis form passwd and group sections because this is needed to get authorization (uid,gid) data from NIS.

The point is, above nsswitch.conf didn't resolve the issue, users are still able to log in using their NIS credentials!

Please help me figure out what is wrong here.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Problem: Automounting Home directory for nis & nfs configuration doesn't work

Hi all, First of all, i am so sorry about my bad level in English writing. I have some problem in linux and i hope the experts of this forum to help me if they have enough time to reply to me. I have a scenario of configuring NIS and NFS in Redhat Linux environment such that user can login... (0 Replies)
Discussion started by: pioneer
0 Replies

2. UNIX for Dummies Questions & Answers

Kerberos Authentication from Application

Hi, We've configured Kerberos to authenticate AIX 5.3 users with Active Directory and I now have to port an application written in C to the new security model. Currently, our users can login as normal and running a "klist" command reveals that they have been successfully granted a ticket. ... (2 Replies)
Discussion started by: phykell
2 Replies

3. UNIX for Advanced & Expert Users

LDAP Authentication AND Authorization

I see a lot of thread on LDAP Authentication but I want to enable LDAP Authentication with Authorization. Meaning, removing the user ID's and groups from the local servers and move them to an LDAP server. When a user logs in (via LDAP) they will be given their group memberships and access to the... (3 Replies)
Discussion started by: scottsl
3 Replies

4. Programming

Kerberos Authentication c/c++

I am in the process of developing a application that needs to be able to authenticate users details with a kerberos server, which is proving to be rather difficult. There seems to be a lack of good information on how to do this using the MIT kerberos api. Can anyone point me in the right... (0 Replies)
Discussion started by: mshindo
0 Replies

5. UNIX for Advanced & Expert Users

PAM authentication.

I have applied pam authentication for local users as highlighted in below file. # cat /etc/pam.d/system-auth #%PAM-1.0 # This file is auto-generated. # User changes will be destroyed the next time authconfig is run. auth required pam_env.so auth sufficient pam_unix.so... (0 Replies)
Discussion started by: pinga123
0 Replies

6. AIX

SSH and kerberos authentication problem AIX 5.3

I've configured an AIX 5.3 client to use our Windows AD for user authentication via Kerberos. When I try to ssh to the server using the AD credentials, I eventually get access but not after getting prompted for a password 3 times (which doesn't work) followed by an accepted login on the 4th... (3 Replies)
Discussion started by: jmroderick
3 Replies

7. UNIX for Advanced & Expert Users

Authentication and Authorization from Separate Domains

The company I work for is trying to implement Sudoers.LDAP to centralize their sudoers infrastructure so the access management team and compliance teams don't have to run ragged over all of our servers. The AD team decided it would be better to set up a separate LDAP server rather than put a new... (1 Reply)
Discussion started by: Wolvendeer
1 Replies

8. UNIX for Dummies Questions & Answers

Kerberos Authentication error

Hi , I am trying to authenticate my id on client server with Kerberos and receiving below error kinit rpagadala@BDC.soft.net kinit: Cannot contact any KDC for realm 'BDC.soft.net' while getting initial credentials Please find krb5.conf on the client server configuration which is... (1 Reply)
Discussion started by: Tomlight
1 Replies

9. Shell Programming and Scripting

PERL and Kerberos authentication

I am installing Authen::Krb5::Easy and during make test I am getting the follwing error : kinit not ok 2 error was: could not get initial credentials: Cannot contact any KDC for requested realm we are stroring krb5.conf in diff location ( not in /etc/krb5.conf) , but, PERL is... (1 Reply)
Discussion started by: talashil
1 Replies

10. SuSE

Authentication with PAM

Hello all, I recently updated PAM policy files (pam_authz.policy) on HP-UX Servers with AD groups involving allowing and denying the certain groups.. Could anyone tell me what is the equivalent mechanism in SLES(Linux)? Is it possible to allow/deny AD group access with the SLES LDAP... (0 Replies)
Discussion started by: lcclaj0
0 Replies
pam_krb5(5)							File Formats Manual						       pam_krb5(5)

NAME
pam_krb5 - authentication, account, session and password management modules for Kerberos 5 SYNOPSIS
/usr/lib/security/$ISA/libpam_krb5.so.1 DESCRIPTION
The KRB5 PAM modules allow integration of Kerberos authentication into the system entry services (such as login, using pam.conf(4) configu- ration file. The Kerberos service module for PAM consists of the following three modules: the authentication module, the account management module and the password module. It also provides null functions for session management. All modules are supported through the same dynami- cally loadable library. The KRB5 PAM modules are compatible with MIT Kerberos 5 and Microsoft Windows 2000. Authentication Module The authentication module verifies the user identity and sets the user credentials. It passes the authentication key derived from the user's password to the Kerberos security service. The security service uses the authentication key to verify the user and issues a ticket- granting ticket. The credential management function sets user specific credentials. It stores the credentials in a cache file and exports the environment variable KRB5CCNAME to identify the cache file. The cache file is stored in /tmp/pam_krb5/creds directory. This module cre- ates a unique cache file for every session. The credentials cache should be destroyed by the user at logout with kdestroy(1m). The following options may be passed to the authentication module through pam.conf(4): debug This option allows syslog(3C) debugging information at LOG_DEBUG level. use_first_pass This option allows the initial password (entered when the user is authenticated to the first authentication module in the stack) to authenticate with Kerberos. If the user cannot be authenticated or if this is the first authentication module in the stack, quit without prompting for a password. It is recommended that this option be used only if the authentication mod- ule is designated as optional in the pam.conf(4) configuration file. try_first_pass This option allows the initial password (entered when the user is authenticated to the first authentication module in the PAM stack) to authenticate with Kerberos. If the user cannot be authenticated or if this is the first authentication module in the stack, prompt for a password. forwardable This option allows a ticket-granting ticket with a different network address than the present ticket-granting ticket to be issued to the user. For forwardable tickets to be granted, the user's account in Kerberos must specify that the user can be granted forwardable tickets. renewable=<time> This option allows tickets issued to the user to be renewed. For renewable tickets to be granted, the user's account in Ker- beros must specify that the user can be granted renewable tickets. The renewal time of the ticket-granting ticket is speci- fied by <time>. The form of time is the same as the one in kinit(1m). proxiable This option allows a ticket with a different network address than the present ticket to be issued to the user. For proxiable tickets to be granted, the user's account in Kerberos must specify that the user can be granted proxiable tickets. ignore Returns PAM_IGNORE. Generally this option should not be used. But sometimes it may not be desirable or may not be necessary to authenticate certain users (root, ftp, ...) with Kerberos. In such cases you can use this option in pam_user.conf(4) for per user configuration. It is not recommended for you to use this option in pam.conf(4). See the examples section. Account Management Module The account management module provides a function to perform account management. This function retrieves the user's account and password expiration information from Kerberos database and verifies that they have not expired. The module does not issue any warning if the account or the password is about to expire. The following options can be passed to the Account Management module through pam.conf(4): debug This option allows syslog(3C) debugging information at LOG_DEBUG level. ignore Returns PAM_IGNORE. Generally this option should not be used. But sometimes it may not be desirable or may not be necessary to authenticate certain users (root, ftp, ...) with Kerberos. In such cases you can use this option in pam_user.conf(4) for per user configuration. It is not recommended for you to use this option in pam.conf(4). See the examples section. Password Management Module The password management module provides a function to change passwords in the Kerberos password database. Unlike when changing a Unix pass- word, the password management module will allow any user to change any other's password(if the user knows the other's old password, of course). Also unlike Unix, root is always prompted for the user's old password. The following options can be passed into the password module through the pam.conf(4) file: debug This option allows syslog(3C) debugging information at LOG_DEBUG level. use_first_pass This option allows the initial password (entered when the user is authenticated to the first authentication module in the stack) to authenticate with Kerberos. If the user cannot be authenticated or if this is the first authentication module in the stack, quit without prompting for a password. It is recommended that this option be used only if the authentication mod- ule is designated as optional in the pam.conf(4) configuration file. try_first_pass This option allows the initial password (entered when the user is authenticated to the first authentication module in the PAM stack) to authenticate with Kerberos. If the user cannot be authenticated or if this is the first authentication module in the stack, prompt for a password. ignore Returns PAM_IGNORE. Generally this option should not be used. But sometimes it may not be desirable or may not be necessary to authenticate certain users (root, ftp, ...) with Kerberos. In such cases you can use this option in pam_user.conf(4) for per user configuration. It is not recommended for you to use this option in pam.conf(4). See the examples section. Session Management Module The session management module provides functions to initiate and terminate sessions. Since session management is not defined under Ker- beros, both of these functions simply return PAM_SUCCESS. They are provided only because of the naming conventions for PAM modules. The following options can be passed into the session management module through the pam.conf(4) file: debug This option allows syslog(3C) debugging information at LOG_DEBUG level. ignore Returns PAM_IGNORE. Generally this option should not be used. But sometimes it may not be desirable or may not be necessary to authenticate certain users (root, ftp, ...) with Kerberos. In such cases you can use this option in pam_user.conf(4) for per user configuration. It is not recommended for you to use this option in pam.conf(4). See the examples section. EXAMPLE
Following is a sample configuration in which no authentication is done with Kerberos for root ie. KRB5 PAM module does nothing. It just returns PAM_IGNORE for user root. For every user other than root, it will try to authenticate using Kerberos. If Kerberos succeeds, the user is authenticated. If Kerberos fails to authenticate the user, PAM will try to authenticate via UNIX PAM using same the password. PAM_IGNORE for user root. pam_user.conf: # configuration for user root. KRB5 PAM module uses the # ignore option and returns PAM_IGNORE root auth libpam_krb5.so.1 ignore root password libpam_krb5.so.1 ignore root account libpam_krb5.so.1 ignore root session libpam_krb5.so.1 ignore pam.conf: # For per user configuration the libpam_updbe.so.1 (pam_updbe(5)) module # must be the first module in the stack. If Kerberos authentication # is valid the UNIX authentication function will not be invoked. login auth required libpam_hpsec.so.1 login auth required libpam_updbe.so.1 login auth sufficient libpam_krb5.so.1 login auth required libpam_unix.so.1 try_first_pass login password required libpam_hpsec.so.1 login password required libpam_updbe.so.1 login password required libpam_krb5.so.1 login password required libpam_unix.so.1 try_first_pass login account required libpam_hpsec.so.1 login account required libpam_updbe.so.1 login account required libpam_krb5.so.1 login account required libpam_unix.so.1 login session required libpam_hpsec.so.1 login session required libpam_updbe.so.1 login session required libpam_krb5.so.1 login session required libpam_unix.so.1 NOTES
The use of pam_hpsec is mandatory for services like login, dtlogin, su, ftp, rcomds and sshd (see attached pam.conf). It is required that these services stack this module above one or more additional modules such as pam_unix, pam_kerberos, etc... However, for 'OTHER' services, pam_hpsec is not configured by default. System administrators and application writers must consider whether it is appropriate to use pam_hpsec for any given application. SEE ALSO
pam(3), pam_authenticate(3), pam_setcred(3), syslog(3C), pam.conf(4), pam_user.conf(4), pam_updbe(5), kinit(1m), klist(1m), kdestroy(1m) pam_krb5(5)
All times are GMT -4. The time now is 04:20 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy