I am not so into Linux and I have the following problem related to how permanentlyunset some environment variables.
The problem is that each time that I log into my system, performing the env command I obtain some variables that I have to permanently remove, in particular:
my.username@VHCLWSO2AS02:~$ env
..........................................
HTTP_PROXY=http://127.0.0.1:3128
HTTPS_PROXY=http://127.0.0.1:3128
http_proxy=http://127.0.0.1:3128
https_proxy=http://127.0.0.1:3128
.........................................
.........................................
.........................................
these for variables related to proxy have to be permanently removed (for all the users, also for the root user) and I am not sure how to do it.
The .profile file inside the logged user home direcoty contains:
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.
# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022
# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/.local/bin" ] ; then
PATH="$HOME/.local/bin:$PATH"
fi
I can't see environment variales declaration inside this file.
The .bashrc file inside the logged user home directory contains:
# sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'$
# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi
The /etc/environment file should contain evironmnet variables declaration that affect the system as a whole (rather than just a particular user) contains:
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
#http_proxy=http://10.173.17.92:3128
#https_proxy=http://10.173.17.92:3128
#HTTP_PROXY=http://10.173.17.92:3128
#HTTPS_PROXY=http://10.173.17.92:3128
This contains my variables definition, I commented out these variables to permanently unset them some times ago. I never restarted the system because it is a server and I can't do it. I am not sure that this no restart situation can be the cause of my problem (I can just log out the session).
Why I still obtain these variable each time that I log again into my system via SSH? What have I to do to permanently delete these variables? What am I missing?