1

in Ubuntu 13.04 I tried to insert

export socks_proxy=socks://address:port

into ~/.profile but this is not working.

PS: I need to set it only for a user so not in /etc/enviroment.

1
  • Which client tool should use this env variable?
    – Node
    Aug 27, 2013 at 14:04

1 Answer 1

2

A few points:

  • Environment variables are case-sensitive. Environment variables like this tend to be uppercase.
  • If you're testing in bash, note the top of the ~/.profile file:

    # ~/.profile: executed by the command interpreter for login shells.
    # This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
    # exists.
    # see /usr/share/doc/bash/examples/startup-files for examples.
    # the files are located in the bash-doc package.
    
  • The help wiki recommends using ~/.pam_environment instead of other files for session environment variables.

  • Its syntax is different than what you're expecting. See: http://linux.die.net/man/5/pam_env.conf
  • So (assuming ~/.pam_environment) you're probably looking for:

    SOCKS_PROXY DEFAULT=socks://address:port
    

Otherwise this is probably just a case issue.


You mention that you're using a browser and in there may lie the actual issue. Firefox, ignores environment variables by default. There is a plugin that will look for environment variables though (it's quite old):

I'm not sure how other browsers handle these things but I wouldn't be surprised if they do also ignore them.

2
  • Hello, thank you for the reply. Actually when you use the system settings to set the proxy globally it exports it lowercase in /etc/environement. That's why I used the lowercase version. By the way I tried ~/.pam-environment and it is correctly exporting the variable (I check using env), but still the browser in not connecting through the proxy. I tried both socks_proxy and SOCKS_PROXY.
    – glsorre
    Aug 27, 2013 at 14:04
  • @Gius1982 Fair enough on the formatting and name. I've added an edit about browsers not using environment variables.
    – Oli
    Aug 27, 2013 at 14:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .