Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a group of users on my server, "Developers", and I would like an environment variable to be set for them whenever they login.

More specifically, when anyone in this group logs in, I would like the equivalent of:

setenv ANDROID_SDK_HOME /Developers/Android/User

to be set at login. I can do this with a login script if necessary, but what I'm asking is: is it possible to set this type of thing in Profile Manager, Workgroup Manager, Directory Utility, etc?

share|improve this question

You could use a similar approach as this solution:

Essentially, create a directory & file owned by developers with group read permissions:

chmod 0660 /etc/profile.d/developers



and add a line like this:

source /etc/profile.d/developers 2 &>1 /dev/null

Only developers will have the ability to read the file, while non developers won't see the error that they can't.

share|improve this answer

You could use "session required ..." in your /etc/pam.d/common-session but you'd need some logic to take care of the group stuff, perhaps from .

run "man pam_env" for details.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.