Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Looks like this bug has been around for quite a while! Here are some bug references you may find helpful (and may want to subscribe to / vote up, hint, hint...):</p> <hr> <p><a href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=85123" rel="noreferrer" title="sudo: SECURE_PATH still can&#39;t be overridden">Debian bug #85123 ("sudo: SECURE_PATH still can't be overridden") (from 2001!)</a></p> <blockquote> <p>It seems that Bug#20996 is still present in this version of sudo. The changelog says that it can be overridden at runtime but I haven't yet discovered how.</p> </blockquote> <p>They mention putting something like this in your sudoers file:</p> <pre><code>Defaults secure_path="/bin:/usr/bin:/usr/local/bin" </code></pre> <p>but when I do that in Ubuntu 8.10 at least, it gives me this error:</p> <pre><code>visudo: unknown defaults entry `secure_path' referenced near line 10 </code></pre> <hr> <p><a href="https://bugs.launchpad.net/ubuntu/+source/sudo/+bug/50797" rel="noreferrer" title="sudo built with --with-secure-path is problematic">Ubuntu bug #50797 ("sudo built with --with-secure-path is problematic")</a></p> <blockquote> <p>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.</p> <hr> <p>Yes. There <em>needs</em> 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.</p> <hr> <p>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.</p> <hr> <p>I worked around it like this:</p> <pre><code>mv /usr/bin/sudo /usr/bin/sudo.orig </code></pre> <p>then create a file /usr/bin/sudo containing the following:</p> <pre><code>#!/bin/bash /usr/bin/sudo.orig env PATH=$PATH "$@" </code></pre> <p>then your regular sudo works just like the non secure-path sudo</p> </blockquote> <hr> <p><a href="https://bugs.launchpad.net/ubuntu/+source/sudo/+bug/192651/" rel="noreferrer" title="sudo path is always reset">Ubuntu bug #192651 ("sudo path is always reset")</a></p> <blockquote> <p>Given that a duplicate of this bug was originally filed in July 2006, I'm not clear how long an ineffectual env_keep has been in operation. Whatever the merits of forcing users to employ tricks such as that listed above, surely the man pages for sudo and sudoers should reflect the fact that options to modify the PATH are effectively redundant.</p> <p>Modifying documentation to reflect actual execution is non destabilising and very helpful.</p> </blockquote> <hr> <p><a href="https://bugs.launchpad.net/ubuntu/+source/sudo/+bug/226595" rel="noreferrer" title="impossible to retain/specify PATH">Ubuntu bug #226595 ("impossible to retain/specify PATH")</a></p> <blockquote> <p>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.....</p> <p>I tried the following to fix this without sucess: </p> <ol> <li><p>Using the "<code>sudo -E</code>" option - did not work. My existing PATH was still reset by sudo </p></li> <li><p>Changing "<code>Defaults env_reset</code>" to "<code>Defaults !env_reset</code>" in /etc/sudoers -- also did not work (even when combined with sudo -E) </p></li> <li><p>Uncommenting <code>env_reset</code> (e.g. "<code>#Defaults env_reset</code>") in /etc/sudoers -- also did not work.</p></li> <li><p>Adding '<code>Defaults env_keep += "PATH"</code>' to /etc/sudoers -- also did not work.</p></li> </ol> <p>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.</p> </blockquote>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload