admin is not in the sudoers file.

1.解决admin is not in the sudoers file.  This incident will be reported.
php

先切换超级管理员用户:su -html

cd  /etc
vim

先修改其权限:增长用户的写权限,chmod u+w sudoers
ide

 vim  /etc/sudoersui

    找到这行 root ALL=(ALL) ALL,在他下面添加url

    username ALL=(ALL) ALLspa

保存退出,记得必定要把sudoers权限还原,不然会无效。3d

还原权限:chmod 440 sudoers
htm


2.解决sudo: no valid sudoers sources found, quittingci

    设置普通用户能够使用sudo

    chmod u+w /etc/sudoers

    vi /etc/sudoers

    找到这行 root ALL=(ALL) ALL,在他下面添加

    username ALL=(ALL) ALL

    可是返回后使用sudo时出现错误:sudo: no valid sudoers sources found, quittin

    解决方法是须要将/etc/sudoers的权限恢复成440,就切换到普通用户下去执行

    sudo ifconfig

    报如下错误:

    sudo: /etc/sudoers is mode 0640, should be 0440

    sudo: no valid sudoers sources found, quitting

    退出普通用户,在root下执行:

    chmod u-w /etc/sudoers

    或

    chmod 440 /etc/sudoers

相关文章
相关标签/搜索