OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
Altering entered PAM username

From: Julián de Navascués (julian.navascuesgmail.com)
Date: Thu Nov 20 2008 - 13:09:45 CST


Hi all,

I wonder if it's possible to change the username inside a PAM auth module. I
would like to do something like login with a user "guest" and map it to a
real unix user account, for example "real_user" (like a switch user command,
"su real_user")...

I have tried something like this:

int pam_sm_authenticate(pam_handle_t *pamh,int flags,int argc,const char
**argv)
{

int retval = pam_set_item(pamh, PAM_USER, "real_user");

return PAM_SUCCESS;

}

Using this auth module with a ssh server I would expect to login as
"real_user" and see a prompt like real_usermachine$ and /home/real_user as
the working directory... but it does not and logs that "guest" is not a
valid unix user on the machine.

I would like to know what else is needed to map users...

Thank for your help

_______________________________________________
Pam-list mailing list
Pam-listredhat.com
https://www.redhat.com/mailman/listinfo/pam-list