咦,孰为汝多知乎

号称健壮异常的Linux,只要将目录 /usr/bin 的拥有者,由 root 转移为 当前用户,那么这个sudo就坏掉了,再也无法使用:

leftfist@localhost ~]$ sudo chown -R $USER /usr/bin 
[sudo] password for leftfist: 
[leftfist@localhost ~]$ ll /usr
total 136
dr-xr-xr-x.   2 leftfist root 36864 Oct 20 01:21 bin
drwxr-xr-x.   2 root     root  4096 Sep 23  2011 etc
drwxr-xr-x.   2 root     root  4096 Sep 23  2011 games
drwxr-xr-x.  32 root     root  4096 Oct 15 14:58 include
dr-xr-xr-x.  98 root     root 45056 Oct 15 21:41 lib
drwxr-xr-x.  23 root     root 12288 Oct 20 01:21 libexec
drwxr-xr-x.  11 root     root  4096 Oct 15 14:54 local
dr-xr-xr-x.   2 root     root 12288 Oct 15 21:41 sbin
drwxr-xr-x. 171 root     root  4096 Oct 20 01:21 share
drwxr-xr-x.   4 root     root  4096 Oct 15 14:54 src
lrwxrwxrwx.   1 root     root    10 Oct 15 14:54 tmp -> ../var/tmp
[leftfist@localhost ~]$ sudo 
sudo: effective uid is not 0, is sudo installed setuid root?

$ su -

# sudo chown -R root /usr/bin

将拥有者再转回root,已经于事无补。在网上疯狂搜索,也暂时找不到什么答案。

不过,这样搞了以后,似乎当前用户也成了超级用户,可以直接reboot,poweroff什么的。

原文地址:https://www.cnblogs.com/leftfist/p/4257851.html