Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am using CentOS 6.3 and want to enable ssh RADIUS authentication along with Centos system Authentication.

Right now my server is firstly authenticated with RADIUS server. And after system Authentication. I want the server to authenticate with unix credentials first and after that to do authentication via RADIUS.

I'm pretty sure about that I have set something inside the file /etc/pam.d/sshd, but I'm not sure what it is I should set.

The configuration I'm using now is:

auth       required   /lib64/security/pam_radius_auth.so
auth include  system-auth
account    required   /lib64/security/pam_stack.so service=system-auth
password   required   /lib64/security/pam_stack.so service=system-auth
session    required   /lib64/security/pam_stack.so service=system-auth

If I use above first RADIUS Authentication then CENTOS System Authentication. What I need is to change this to first CentOS System Authentication then RADIUS Authentication.

share|improve this question

1 Answer 1

In a pam config, the order matters. If authentication requires the user auth against both system and radius to be successful, move auth include system-auth above auth required /lib64/security/pam_radius_auth.so.

If not, grab all the auth lines from the system-auth file and copy them to this file. Change any lines you copied from required to sufficient and place them above pam_radius_auth.so. Comment out or remove the auth include system-auth line.

If pam encounters a sufficient line and it passes, it will log in skipping the remainder, but failure will not immediately abort the authentication process. If it failed, it will try the remaining lines in order.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.