How to set socks5 proxy from command line?

I can set socks5 proxy using Gnome Settings. However, how can I set it using a shell script? It turns out the setting just set a new environment variable called ALL_PROXY. But it seems the variable is set at gnome session level, which will not work if I just add the environment variable in .bashrc. How can I do that from command line?

Nope. Not sure where you got that from. Neither GNOME nor libproxy knows about that environment variable, so it’s just going to be ignored if you set it.

Use:

$ gsettings set org.gnome.system.proxy.socks host example.com
$ gsettings set org.gnome.system.proxy.socks port 1234
$ gsettings set org.gnome.system.proxy mode 'manual'

This will break in the future; you can follow this issue if you want some heads-up when that happens.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.