看起来这个bug已经存在很长一段时间了!以下是一些你可能会觉得有用的bug参考(可能会想订阅/投票,提示,提示…)
Debian bug #85123(“sudo: SECURE_PATH仍然不能被覆盖”)(2001年!)
这个版本的sudo中似乎仍然存在Bug#20996。的
changelog说它可以在运行时被覆盖,但我还没有
如何发现的。
他们提到在你的sudoers文件中放置这样的东西:
Defaults secure_path="/bin:/usr/bin:/usr/local/bin"
但是当我至少在Ubuntu 8.10中这样做时,它给了我这个错误:
visudo: unknown defaults entry `secure_path' referenced near line 10
Ubuntu bug #50797(“使用——with-secure-path构建的sudo有问题”)
Worse still, as far as I can tell, it
is impossible to respecify secure_path
in the sudoers file. So if, for
example, you want to offer your users
easy access to something under /opt,
you must recompile sudo.
Yes. There needs to be a way to
override this "feature" without having
to recompile. Nothing worse then
security bigots telling you what's
best for your environment and then not
giving you a way to turn it off.
This is really annoying. It might be
wise to keep current behavior by
default for security reasons, but
there should be a way of overriding it
other than recompiling from source
code! Many people ARE in need of PATH
inheritance. I wonder why no
maintainers look into it, which seems
easy to come up with an acceptable
solution.
I worked around it like this:
mv /usr/bin/sudo /usr/bin/sudo.orig
then create a file /usr/bin/sudo containing the following:
#!/bin/bash
/usr/bin/sudo.orig env PATH=$PATH "$@"
then your regular sudo works just like the non secure-path sudo
Ubuntu bug #192651(“sudo路径总是重置”)
假设这个bug的副本是
最初是在2006年7月提交的,我不是
清楚一个无效的env_keep多长时间
一直在运作。无论
强迫用户使用的优点
如上所列的技巧,
当然是sudo的手册页
Sudoers应该反映这一事实
修改路径的选项为
有效的冗余。
修改文档以反映
实际执行不会破坏稳定
而且很有帮助。
Ubuntu bug #226595(“无法保留/指定PATH”)
I need to be able to run sudo with
additional non-std binary folders in
the PATH. Having already added my
requirements to /etc/environment I was
surprised when I got errors about
missing commands when running them
under sudo.....
I tried the following to fix this
without sucess:
Using the "sudo -E" option - did not work. My existing PATH was still reset by sudo
Changing "Defaults env_reset" to "Defaults !env_reset" in /etc/sudoers -- also did not work (even when combined with sudo -E)
Uncommenting env_reset (e.g. "#Defaults env_reset") in /etc/sudoers -- also did not work.
Adding 'Defaults env_keep += "PATH"' to /etc/sudoers -- also did not work.
Clearly - despite the man
documentation - sudo is completely
hardcoded regarding PATH and does not
allow any flexibility regarding
retaining the users PATH. Very
annoying as I can't run non-default
software under root permissions using
sudo.