I'd like to set default http proxy for all users under my FreeBSD environment. I modified /etc/login.conf file by adding HTTP_PROXY variable:

:path=/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin ~/bin:\

and runned

# cap_mkdb /etc/login.conf

but after next login env command doesn't show me the variable. What am I doing wrong?


There's already an example of how to do this properly in the same file:


you need to use the setenv setting, which can be a comma-separated list.


I've also edited the proxy URL, since AFAIK, it needs to have the protocol defined.

(sources: here and here)

  • 1
    No colon needed after BLOCKSIZE=K :setenv=MAIL=/var/mail/$,BLOCKSIZE=K\ ,HTTP_PROXY=http\c//proxy-chain.server.com\c911:\ And stupid limit doesn't allow me to edit post above: "Edits must be at least 6 characters.."
    – citrin
    Aug 12 '16 at 15:32
  • Not quite sure which colon you think is wrong, I read it again, but can't see the error you mean. Maybe you should check the sources to see how it works.
    – madeddie
    Aug 12 '16 at 15:34
  • Env vars is comma-separated list. In your post variables BLOCKSIZE and HTTP_PROXY are separated by :, not by just ,
    – citrin
    Aug 12 '16 at 15:37
  • you are so right, awesome, fixed!
    – madeddie
    Aug 12 '16 at 17:23
  • 1
    It turned out that \c for colon is documented. Full list of escape codes can be found in getcap(3) section CGETNUM AND CGETSTR SYNTAX AND SEMANTICS. Not obvious place to look if you try to write value with colon in /etc/login.conf
    – citrin
    Aug 13 '16 at 17:07

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.