Re: PATH di sudo
On Thu, Sep 4, 2008 at 9:34 AM, Enrico La Cava <enrico.lacava@yahoo.it> wrote:
>
> Il giorno 04/set/08, alle ore 09:13, Alberto ha scritto:
>>
>>
>>
>> Qualcuno sa dove sudo setta il suo PATH?
>>
>>
> Basta che modifichi il file bash.bashrc per root. Mettilo in /root e vedrai
> che funziona
>>
>> p.s.
>> Sapete anche dove viene settato il PATH normale,
>> per poter aggiungere :/opt/schily/bin
>> ho dovuto aggiungere in bash.bashrc
>>
>>
>> export PATH=$PATH:/opt/schily/bin
>
> Dipende quale file bash.bashrc hai modificato, se è quello sotto /etc
> dovrebbe essere cambiato per tutti, root compreso.
si ho modificato
/etc/bash.bashrc
infatti per root funziona, il problema è proprio sudo
# env | grep PATH
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/schily/bin
$ sudo env | grep PATH
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin
# head sudoers
Defaults env_keep += "PATH"
Defaults env_reset
che secondo il manuale di sudoers
...
env_reset If set, sudo will reset the environment to only
contain the LOGNAME,
SHELL, USER, USERNAME and the SUDO_* variables.
Any variables in the
caller's environment that match the env_keep
and env_check lists are
then added. The default contents of the
env_keep and env_check lists
are displayed when sudo is run by root with the
-V option. If sudo was
compiled with the SECURE_PATH option, its value
will be used for the
PATH environment variable. This flag is on by default.
che se il mio inglese non mi inganna dovrebbe bastare.
ma non funziona
>>
>> grazie
>> AG
>
> Ciao
>
> Enrico
>
Reply to: