Adding Defaults env_keep in visudo

In my previous two blog I have discussed problem with add-apt-repository behind proxy and x-server problem with sudo command. In both cases solution was to add Defaults env_keep in sudoer's file. like
Defaults env_keep="DISPLAY XAUTHORITY" (for gedit)
Defaults env_keep="http_porxy" (for adding repository)
Problem is, if you add line like above, one that is las line work. Because above command actually keep envs that at the last line and reset all others. To add more than one env variable you can use any of the following methods.

First method:
You can specify, as many env variable as you want, in side the quote, separated by space. For example:
Defaults env_keep="http_proxy ftp_proxy DSPLAY XAUTHORITY"


Second Method:
You can use "+=" sign instead of "=" sign in the command. For example:
Defaults env_keep+="DSPLAY XAUTHORITY"
Defaults env_keep+="http_proxy"



Both are equally good method. You can use any method according to choice.

Cheers
A.Paul

Comments

Popular posts from this blog

Changing caption width in latex

Subtitle in latex

Placing float (table or figure) at the top of the page in otherwise empty page in LaTeX