PAM module to perform auth and change username

Krishna Kumar2 krkumar2 at in.ibm.com
Thu Nov 14 09:33:42 UTC 2013


Hi all,

I had a somewhat unique problem relating to PAM on a RHEL system. I hope
someone can take a look and check if there is a way to get this work.

Suppose the Linux box has a user account "A". On the console, I login with
"B",
or "C".  I have written a small PAM module that asks for a PW, and upon
some
internal authentication, it changes the PAM_NAME to "A" and returns
success.
Basically it maps multiple non-existent system logins to a single system
login.
This module is marked "sufficient" and ordered before pam_unix. Now I am
able
to login as "A", but only if "B", or "C", are present in /etc/passwd. If
they are not
present, after my module, the pam_unix module again asks for password, and
returns error at the end of the sequence.

Is it possible to login to a system with a non-existent account by
modifying the
username to a valid account in this manner?

Thanks for any help/pointers!

Regards,

- KK




More information about the Pam-list mailing list