I'm using socks proxy over ssh tunnel
ssh -D 1080 -f -C -q -N <user>@<server>
when I set the proxy in System settings > Network > Network proxy
, all applications like Chromium, Firefox, apt, ...
are following the proxy.
now I want to write a shell script for automation,
how can I set Network proxy
by terminal?
all I found is "use some third-party software like Tsocks
and …".
but as I said, the ubuntu it self can do this without any third-party software so don't want to use them.
all I want is set Network proxy
using a command in terminal.
Best Answer
as @taifwa said, Systemwide proxy settings in ubuntu was the solution.
and here is my script:
run as root is required for editing
environment
andapt.conf
,edit:
but it's important to know editing
org.gnome.system.proxy
as root has no effect on current user, so them should run as normal user. so don't run the script with sudo