Score:0

proxy is only working with GUI but not when I set through terminal with ~/.bashrc

gb flag

I have read a lot of guides about setting a proxy for ubuntu. I can do it with the GUI in the network settings and it automatically starts using the proxy I specified and when I open firefox or chrome to check my ip it shows the proxy ip.

But I'm not able to get it working with terminal by editing the ~/.bashrc file. I do it like this:

sudo nano ~/.bashrc

then add this at the end of the file

export HTTP_PROXY="my_proxy:my_port"
export HTTPS_PROXY="my_proxy:my_port"
export FTP_PROXY="my_proxy:my_port"

then I save the changes and run the command

source ~/.bashrc

But when I open the web browser my IP did not change, I also tried rebooting the system but the ip remains the same.

cn flag
Your .bashrc only applies to your bash shells (and programs spawned from it), not to your GUI login session as a whole. Try adding the values to `/etc/security/pam_env.conf`
Camilo avatar
gb flag
I got the same result
Camilo avatar
gb flag
@glennjackman Do you where are the changes made manually with GUI stored?
raj avatar
cn flag
raj
The proxy settings in GUI and in the terminal are independent and complementary to each other. GUI programs use the settings you define in GUI; command-line tools like `wget` use the environment variables you define in the terminal. To use proxy both in GUI and on command line, you have to define both.
cn flag
Have a look at https://askubuntu.com/q/78856/10127
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.