Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I struggle to see the difference between pam_env.conf and /etc/environment. To me they both do the same thing, with a difference syntax. The manpages were no help. So what is the difference?

Additionally, I'd like to find a way to add paths to the PATH environment variable for all users. Adding them to the two aforementioned files works for all users, but doesn't work with sudo, as can be verified by running sudo sh -c 'echo $PATH'.

To solve that problem, I believe I should edit the file /etc/pam.d/sudo, but what should I put in there?

share|improve this question
add comment

1 Answer

I managed to get more or less what I wanted for sudo:

I edited the /etc/sudoers file (with sudo visudo) and commented out the lines Default env_reset and Default secure_path = ....

Now sudo will use the user's environment.

The difference between pam_env.conf and /etc/environmentstill isn't clear to me tough, so the question is not yet answered.

share|improve this answer
add comment

Your Answer

 
discard

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.