原作者:feelam
今天用普通用户在终端 sudo的时候却返回提示:(feelam是我的用户名)
feelam is not in the sudoers file. This incident will be reported.
以前经常用sudo来作事情也没这提示我用户不在/etc/sudoers里面阿!真奇怪。
查询了下资料,说什么必须将用户添加进来哦,为了方便我就直接给它一句
## Allow root to run any commands anywhere
root ALL=(ALL) ALL
feelam ALL=(ALL) ALL
可惜我不懂visudo命令如何编写,只能用最普通的方法:
1、root登录
2、进入/etc
3、编辑sudoers文件,添加如上语句
4、另存为sudoers文件到桌面(直接另存为覆盖会提示不能写文件到只读文件夹!)
5、复制文件,覆盖掉/etc/sudoers
6、cd /etc
7、chmod 0440 sudoers (因为我会到普通用户用sudo的时候提示我文件必须为0440权限)
OK,菜鸟的解决方法。

