sudo问题解决 用户名is not in the sudoers file

    技术2022-05-20  67

    用sudo时提示:用户名is not in the sudoers file。This incident will be reported。

    原因:你的用户名没有权限使用sudo,需要修改一下 /etc/sudoers 文件。

    1.进入root模式。可以进入恢复模式,直接进入root模式

    2.chmod u+w /etc/sudoers,增加写权限

    3.vi /etc/sudoers

    root ALL=(ALL) ALL,下面增加

    *** ALL=(ALL) ALL,保存。

    4.chmod u-w /etc/sudoers,撤消写权限。

    如果使用sudo提示找不到命令时,可以试试在命令前加入 /sbin/ 命令。


    最新回复(0)