解决sudo: no valid sudoers sources found, quitting

设置普通用户可以使用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

猜你喜欢

转载自thierry-xing.iteye.com/blog/1866189
今日推荐