How to set a socks proxy server only for one user?

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

1 Answer

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:
  • 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

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like