Who Keeps Putting That Proxy Back in Bash?
Trace a recurring proxy environment variable through Bash startup files and the parent process that launches the shell.
If http_proxy returns in the next terminal, find who supplied it. Another unset at the end of .bashrc can hide the value for one launch while leaving its source active elsewhere.
- Identify the failing launch. Is it an interactive login shell, a non-login terminal, or a non-interactive job? Bash invoked as
shfollows different rules too. - Follow that startup path. An interactive login shell reads
/etc/profileand then the first available user file among~/.bash_profile,~/.bash_loginand~/.profile. An interactive non-login shell normally reads~/.bashrc. A login file may source it explicitly. For non-interactive Bash, account forBASH_ENVwhere applicable. - Find the assignment. Search those files and the files they source for the variable name and old proxy hostname. Include relevant
/etc/profile.dsnippets and uppercase as well as lowercase names. - If startup did not assign it, trace the parent. The shell inherits an environment from its terminal, login session, service manager or development tool. A long-lived parent can retain the old value after you edit a shell file.
For PAM-based logins, check /etc/environment as well. Correct the owning source and start the affected launch path again, refreshing the parent configuration when needed. Keep searches local: startup files and environment dumps can contain credentials. The result to verify is the value inherited by the intended command, rather than the last file that managed to unset it.