how does pam_putenv() work?

Martin inkubus at interalpha.co.uk
Thu Jun 30 19:47:52 UTC 2005


> > 	I'm still fairly new to the PAM world. I'm writing a pam 
> > module now and tried to set up some environment variables for SSHD 
> > by calling pam_putenv() inside the pam_sm_authenticate() call however 
> > it never works. After the user is logged in through SSH, "env" 
> > command never showed those variables I intended to set. The sshd file 
> > under /etc/pam.d looks like this,
<snip>
> > but didn't find anything reltaed to this issue. I also tried to move 
> > the pam_putenv() call into pam_sm_setcred() but it didn't work 
> > either. Am I missing something here?
Have you tried this module with services other than sshd?  OpenSSHD's
interaction with PAM is a little strange at times and it also has some
security controls related to environments.  If it works with other
services then have a look at sshd_config, particularly the values of
PermitUserEnvironment and UsePAM.

HTH

Cheers,
 - Martin





More information about the Pam-list mailing list