Apple Intelligence is now available on iPhone, iPad, and Mac!

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How can I set root environment variables in M1 Mac?

I have a problem with some apps that using root !!!

I think the problem related to proxy setting! anyway I am trying to set the proxy not only for terminal use(already adjusted in .zprofile file) but also for root. I don't know how to adjust this for root file using the ZSH ?

attached the photos for env variables in both cases shell and root to look at the problem of missing the PROXY in root!!

iMac 24″, macOS 12.3

Posted on May 11, 2022 3:06 AM

Reply
Question marked as Top-ranking reply

Posted on May 11, 2022 10:21 AM

You’re up to something rather unusual, if you have the root login enabled.


You start out with an indication you suspect a problem is due to a proxy-related setting…. But not details of what the problem is…


You should be able to set the environment variables using the root login.


For web proxies, it’d be more typical to set those using the system setup, or an MDM profile, or WPAD and the DHCP server.


Change proxy settings in Network preferences on Mac - Apple Support


https://en.wikipedia.org/wiki/Web_Proxy_Auto-Discovery_Protocol


If this is an effort to set up MITM for whatever reason, some network connections will detect and thwart that.

Similar questions

5 replies
Question marked as Top-ranking reply

May 11, 2022 10:21 AM in response to Marzouk22

You’re up to something rather unusual, if you have the root login enabled.


You start out with an indication you suspect a problem is due to a proxy-related setting…. But not details of what the problem is…


You should be able to set the environment variables using the root login.


For web proxies, it’d be more typical to set those using the system setup, or an MDM profile, or WPAD and the DHCP server.


Change proxy settings in Network preferences on Mac - Apple Support


https://en.wikipedia.org/wiki/Web_Proxy_Auto-Discovery_Protocol


If this is an effort to set up MITM for whatever reason, some network connections will detect and thwart that.

May 11, 2022 10:38 PM in response to MrHoffman

Thank you too much,

The problem solved, sorry I didn't mention about the actual problem.

But some apps such as Microsoft teams, Mendeley reference manager, and Notion cannot work the program already installed but cannot lunch and let the GUI to appear. Although most other programs are working (which use or compatible with automatic proxy discovery).

Some terminal programs like Conda did not work until I adjusted the HTTP(S) proxy in the .zprofile.

Therefore, one of my colleagues suggested to adjust the Mac HTTP(S) proxy protocol for the system as whole not just the environment (I meant not just as environmental variable for the command line which affect only programs using the home not root). When I adjusted it through Network --> advanced --> proxy it is already recognized by these programs and they abled to connect the web server through these defined HTTP(S) instead of the automatic discovery

How can I set root environment variables in M1 Mac?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.