You are not logged in.

#1 2010-04-01 10:27:41

theta
Member
From: India
Registered: 2010-01-16
Posts: 162

[Solved] - sudo - proxy server settings

I use a proxy server to connect to the internet. I can export the http_proxy variable to access net via the shell. But using sudo before any command doesn't work with these settings.

wget http://link/

works, but

sudo wget  http://link/

doesn't.

I require sudo to be used with pacman to upgrade my system.

Last edited by theta (2010-04-01 18:43:39)

Offline

#2 2010-04-01 10:46:12

austin.rbn
Member
Registered: 2010-01-23
Posts: 77

Re: [Solved] - sudo - proxy server settings

If you only need the proxy variable for wget, you can change that in /etc/wgetrc

I'm not behind a proxy now, so I can't test this, but... does "sudo export" make it work as you would like? Keep in mind that exporting the proxy variable is local to the particular terminal instance.


"Computer Science is embarrassed by the computer." -- Alan J. Perlis

Offline

#3 2010-04-01 10:59:49

loafer
Member
From: the pub
Registered: 2009-04-14
Posts: 1,769

Re: [Solved] - sudo - proxy server settings

Why do you want to download stuff as root?


All men have stood for freedom...
For freedom is the man that will turn the world upside down.
Gerrard Winstanley.

Offline

#4 2010-04-01 15:57:39

theta
Member
From: India
Registered: 2010-01-16
Posts: 162

Re: [Solved] - sudo - proxy server settings

austin.rbn wrote:

If you only need the proxy variable for wget, you can change that in /etc/wgetrc

I'm not behind a proxy now, so I can't test this, but... does "sudo export" make it work as you would like? Keep in mind that exporting the proxy variable is local to the particular terminal instance.

[theta@boolean-pc ~]$ sudo export http_proxy="http://user:pass@proxy.iist.ac.in:80/"
Password: 
sudo: export: command not found
[theta@boolean-pc ~]$

So this can't be done. Thanks anyway for the suggestion.

Offline

#5 2010-04-01 16:29:51

fumbles
Member
Registered: 2006-12-22
Posts: 246

Re: [Solved] - sudo - proxy server settings

sudo resets your environment variables whenever you run it. To disable this feature you can add:

Defaults !env_reset

to your sudoers file.

Offline

Board footer

Powered by FluxBB