I want to change the temporary directory used by a specific user (jenkins in my case).

The problem is that this needs to be in effect for any process running as Jenkins user and changing it in .profile is not supposed to work because these are non-interactive logins.

1 Answer 1


On most systems, you can set environment variables in the file ~/.pam_environment and they will apply to all login methods, even those that don't start a login shell and so don't load .profile. This file is read by the PAM module pam_env, i.e. the PAM configuration file /etc/pam.conf or /etc/pam.d/XXX for the service that logs the user in should mention the pam_env module.

The syntax of ~/.pam_environment is one VARIABLE=VALUE per line. You can't have any shell syntax such as quoting or references to other variables. In your case you would put a line like


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .