![无法“sudo”任何内容。任何命令都会返回帮助消息](https://linux22.com/image/1004615/%E6%97%A0%E6%B3%95%E2%80%9Csudo%E2%80%9D%E4%BB%BB%E4%BD%95%E5%86%85%E5%AE%B9%E3%80%82%E4%BB%BB%E4%BD%95%E5%91%BD%E4%BB%A4%E9%83%BD%E4%BC%9A%E8%BF%94%E5%9B%9E%E5%B8%AE%E5%8A%A9%E6%B6%88%E6%81%AF.png)
今天更新 Ubuntu 16.04.3 系统后,我无法以非特权用户身份使用 sudo 运行任何命令,也无法以 root 身份运行相同的命令。每次“sudo”调用都只会返回一条帮助消息。
[21:22:06]
[svarog@svarog-PC~]$sudo -s
usage: sudo -h | -K | -k | -V
usage: sudo -v [-AknS] [-g group] [-h host] [-p prompt] [-u user]
usage: sudo -l [-AknS] [-g group] [-h host] [-p prompt] [-U user] [-u user] [command]
usage: sudo [-AbEHknPS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p prompt] [-u user] [VAR=value]
[-i|-s] [<command>]
usage: sudo -e [-AknS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p prompt] [-u user] file ...
[21:37:39]
[root@svarog-PC/etc/sudoers.d]#sudo -i -u svarog
usage: sudo -h | -K | -k | -V
usage: sudo -v [-AknS] [-g group] [-h host] [-p prompt] [-u user]
usage: sudo -l [-AknS] [-g group] [-h host] [-p prompt] [-U user] [-u user] [command]
usage: sudo [-AbEHknPS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p prompt] [-u user] [VAR=value]
[-i|-s] [<command>]
usage: sudo -e [-AknS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p prompt] [-u user] file ...
[21:41:35]
[root@svarog-PC/etc/sudoers.d]#uname -oiros
Linux 4.10.0-41-generic x86_64 GNU/Linux
[21:42:32]
[root@svarog-PC/etc/sudoers.d]#cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.3 LTS"
[21:43:43]
[root@svarog-PC/etc/sudoers.d]#dpkg -l | grep sudo | grep ii
ii gksu 2.0.2-9ubuntu1 amd64 graphical front-end to su and sudo
ii gnome-sudoku 1:3.18.4-0ubuntu2 amd64 Sudoku puzzle game for GNOME
ii libgksu2-0 2.0.13~pre1-6ubuntu8 amd64 library providing su and sudo functionality
ii sudo 1.8.16-0ubuntu1.5 amd64 Provide limited super user privileges to specific users
没有损坏的数据包,没有未配置的数据包,系统日志中没有奇怪的日志错误。SUDO 包已重新安装。没有任何帮助。请问,有人能帮忙吗?
SU 命令运行良好。SUDOERS 文件看起来正常。
答案1
运行alias
。查看 是否有别名sudo
。另外,尝试set | grep sudo
查看那里是否有任何内容。
如果发现任何内容,请在~/.bashrc
和~/.profile
中查找别名或函数覆盖sudo
。