question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Explain 'sudo -E' someplace accessible

See original GitHub issue

Issue triage update by Erik 2021-10-22: this remains relevant.

I suggest a topic guide entry in our documentation about the choices we’ve made to add exempt_group in sudoers to preserve PATH for those users, and how the -E flag is relevant.


It’s important, but need to figure out where to explain it without complicating things

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
kannescommented, Oct 23, 2018

I would also recommend “-H, --set-home” so that users do not get warnings like

The directory ‘/home/jupyter-adminuser/.cache/pip/http’ or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo’s -H flag. The directory ‘/home/jupyter-adminuser/.cache/pip’ or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo’s -H flag.

1reaction
fm75commented, Nov 8, 2018

I have a PR in that adds the -E as part of solving a problem where the installation is behind a proxy.

Read more comments on GitHub >

github_iconTop Results From Across the Web

sudo -E foo - explainshell.com
sudo allows a permitted user to execute a command as the superuser or another user, as specified by the security policy. The real...
Read more >
Why does sudo change the PATH? [closed] - Stack Overflow
In case someone else runs accross this and wants to just disable all path variable changing for all users. Access your sudoers file...
Read more >
Sudo - ArchWiki
Sudo is an alternative to su for running commands as root. Unlike su, which launches a root shell that allows all further commands...
Read more >
How to make `sudo` preserve $PATH? - Unix Stack Exchange
You can always do: sudo env "PATH=$PATH" godi_console. As a security measure on Debian, /etc/sudoers has the secure_path option set to a safe...
Read more >
What does the -E in sudo -E do? - Super User
-E - The -E (preserve environment) option indicates to the security policy that the user wishes to preserve their existing environment variables ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found