Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sudo -Hu 执行时找不到命令的问题解决 - overtrue #28

Open
overtrue opened this issue May 4, 2018 · 0 comments
Open

sudo -Hu 执行时找不到命令的问题解决 - overtrue #28

overtrue opened this issue May 4, 2018 · 0 comments

Comments

@overtrue
Copy link
Owner

overtrue commented May 4, 2018

https://overtrue.me/articles/2015/05/cannot-find-command-sudo-hu.html

虽然在 /etc/profile 中加了全局 PATH,但是在以 sudo -Hu [username] [command] 执行的时候报命令不存在,原因是 /etc/sudoers 中还有一个 secure_path 没修改: visudo 查找 secure_path,加入你要添加的目录,比如 /usr/local/bin: Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin 改为: Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin 即可。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant