0

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.

Camilo
  • 101
  • 1
  • 1
    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` – glenn jackman Sep 28 '21 at 20:21
  • I got the same result – Camilo Sep 28 '21 at 22:13
  • @glennjackman Do you where are the changes made manually with GUI stored? – Camilo Sep 28 '21 at 22:23
  • 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. – raj Sep 28 '21 at 23:12
  • Have a look at https://askubuntu.com/q/78856/10127 – glenn jackman Sep 29 '21 at 00:10

2 Answers2

0

You can write and configure a script. I need to throw a reverse tunnel from the virtual machine (Windows 10) to a Linux VPS on Digital Ocean and then use it back to Win7. I will imitate a situation where Windows 10 is the customer's machine, and the Linux VPS is our server. On the VPS, I install and configure the RsocksTun server side: I install an apt install proxy service provider and get the git clone GitHub as the source. This is a clone that will read the data. In the end, you need to generate an SSL certificate and run the server side.

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Artur Meinild Jul 25 '22 at 06:01
0

You can try using small letters like this:

export http_proxy="my_proxy:my_port"         
export https_proxy="my_proxy:my_port"

if it still doesn't work put those in '/etc/environment'

If you are using apt install you may also edit '/etc/apt/apt.conf.d/proxy.conf' put those in there:

 Acquire::http::Proxy "http://host:port/";                            
 Acquire::https::Proxy "http://host:port/";
andrew.46
  • 37,085
  • 25
  • 149
  • 228