changed sudo path, command continues not being found

孤人 提交于 2019-12-11 06:01:09

问题


I added

export PATH="/home/deltrem/Pedro - Arquivos/play/ps1/linux/pSX:$PATH"

to

/root/.bashrc

, but

sudo pSX

echoes

command not found.


回答1:


Are you logging in as root? If so, then you have no need for sudo.

If not, then the contents of /root/.bashrc won't matter, since the sudo command gets its path from the environment in which it's run. In other words, it copies your user-level path. Instead, edit the path in your user's .bashrc.




回答2:


Is pSX a directory, a file, or both (a directory called pSX containing a file named pSX)? If it's a directory, you need to enter the actual command name instead. If it's a file (but not a directory) then you need to remove the /pSX from the PATH variable.

Does pSX have the executable bit set? The OS might not know that pSX is a command.




回答3:


After spending the past hour banging my head against the wall, I finally figured out how to do this. It has nothing to do with bashrc, profile, or environment. Instead open up /etc/sudoers and change secure_path.



来源:https://stackoverflow.com/questions/2717043/changed-sudo-path-command-continues-not-being-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!