Ubuntu – Find Proxy Server using Command Line

command linePROXY

Someone's set up a proxy on my machine and I want to know what it is. Is there a way to find the proxy server using the command line and not the GUI?

Best Answer

  • For any system-wide proxy for HTTP, you can check the value of http_proxy environment variable:

    echo "$http_proxy"
    

    For HTTPS:

    echo "$https_proxy"
    

    Similarly, there are ftp_proxy, socks_proxy for serving the exact purpose of their names. There is also all_proxy for setting proxy for all these protocols at once. Just to note, no_proxy unsets proxy for any specific addresses of any (or all) given protocol. Just for sake of completeness, you might want to check the uppercase version of these variables too, although the lowercases are standard for *_proxy environment variables (only environment variables i am aware of that are lowercased).

    Note that, these will show any system-wide proxy setting, not application-specific. For example, firefox, or apt can have their own proxy settings irrespective of any global one. Some applications do not honor these variables too (e.g. specific gnome apps use gsettings), so YMMV.

  • Related Question