今天更新 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
。