Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • This is a good way. See also superuser.com/questions/927512/… Commented Apr 10, 2021 at 2:01
  • At least on a RHEL system this would be better done with a file in /etc/sudoers.d/ adding onto the system default. I assume Debian would be similar. Commented Jan 20, 2023 at 19:30
  • e.g. echo 'Defaults secure_path="/sbin:/bin:/usr/sbin:/usr/bin:/my/custom/path"' > /etc/sudoers.d/custom_path Commented Jan 20, 2023 at 23:12