![无需 sudo 即可运行可执行文件,但使用 sudo 则无法运行](https://linux22.com/image/919744/%E6%97%A0%E9%9C%80%20sudo%20%E5%8D%B3%E5%8F%AF%E8%BF%90%E8%A1%8C%E5%8F%AF%E6%89%A7%E8%A1%8C%E6%96%87%E4%BB%B6%EF%BC%8C%E4%BD%86%E4%BD%BF%E7%94%A8%20sudo%20%E5%88%99%E6%97%A0%E6%B3%95%E8%BF%90%E8%A1%8C.png)
我文件夹中有一个程序。我使用 更改了它的权限chmod u+x
。之后,它在终端上无需 sudo 即可运行,但使用 sudo 运行时,它显示error while loading shared libraries: libcudart.so.10.0: cannot open shared object file: No such file or directory
。.so 文件存在于它指向的目录中,但无法使用 sudo 找到。我关注了这个问题可执行文件无需 sudo 即可运行,但使用 sudo 则无法运行但没有运气。请帮忙。我在 Ubuntu 18.04 Server 上运行
我的 /etc/sudoers 文件如下所示
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults env_reset
Defaults mail_badpass
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"
# Host alias specification
# User alias specification
# Cmnd alias specification
# User privilege specification
root ALL=(ALL:ALL) ALL
# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
# See sudoers(5) for more information on "#include" directives:
#includedir /etc/sudoers.d