New comment by cryptomilk on Samba Github repository https://github.com/samba-team/samba/pull/168#issuecomment-383127810 Comment: I think you just need to set a PAM env variable right? pam_wrapper provides a module pam_set_items which also has a manpage: 'man pam_set_items'. You can use it so set the password pam env.