I'm using Debian Jessie. I want to set some environment variables that will persist across reboots and work in non-shell environments.

I've set the following in /etc/environment:


But then if I do the following, it produces nothing:

printenv SECRET_KEY

How do I set this environment variable and activate it?


1 Answer 1


After modifying the /etc/environment file you need to close the shell you are working with and log back in a new shell so that the file is read and applied by the PAM stack.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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