Mapping username in PAM and OpenSSH

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello all,

I have been looking in the archives that somebody talks about changing the username by using PAM (http://www.redhat.com/archives/pam-list/2008-November/msg00009.html).

I am facing with the same problem. I would like to access using OpenSSH another machine in which there is a PAM module that carry out a change of user. Let me explain it better. What I am trying to do is:
  1. Through OpenSSH the user inputs as username 'anonymous' and password 'anonymous' too.
  2. The PAM module tries to map 'guest' to 'system' and doesn't mind about the password.
  3. The final result would be to see the prompt showing 'system@mycomputer$' and the corresponding folder mounted as the working one.
This is the piece of code that is supposed to make the change of user:

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

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

return PAM_SUCCESS;

}


BUT the log says that 'anonymous' is not a valid user and it doesn't log as 'system'. My questions are:

I apologize for such a long mail but I just wanted to be accurate.

Thanks a lot
Have a great day






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

[Index of Archives]     [Fedora Users]     [Kernel]     [Red Hat Install]     [Linux for the blind]     [Gimp]

  Powered by Linux