How to set system-wide environment variables
44
votes
8
answers
87744
views
We used to use
/etc/environment
to set system-wide environment variables on Mountain Lion. However, it seems this file is no longer read.
Ideally the solution should apply to all users, and we need it to work with ssh console sessions. So we need this to work
ssh user@mavericks-machine 'echo $MY_ENV_VAR'
So far we've tried:
- /etc/launchd.conf
Works for all users, but only applies to 'windowed' applications, i.e. works in Terminal, but not in an ssh session.
- ~/.profile
, ~/.bash_profile
etc.
Only applies to shells
Any suggestions?
Asked by joerick
(828 rep)
Oct 31, 2013, 02:41 PM
Last activity: May 2, 2025, 10:04 AM
Last activity: May 2, 2025, 10:04 AM