zoukankan      html  css  js  c++  java
  • 咦,孰为汝多知乎

    号称健壮异常的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什么的。

  • 相关阅读:
    BZOJ 1207
    Poj 2096 Collecting Bugs (概率DP求期望)
    HDU 5159 Card (概率求期望)
    HDU 4649 Professor Tian (概率DP)
    HDU 4652 Dice (概率DP)
    HDU5001 Walk(概率DP)
    C++中的 Round(),floor(),ceil()
    HDU 5245 Joyful(概率题求期望)
    poj 3071 Football (概率DP水题)
    关于一个群号分解的最大质数的求法
  • 原文地址:https://www.cnblogs.com/leftfist/p/4257851.html
Copyright © 2011-2022 走看看