linux系统下使用sudo 提示:xxx is not the sudoers file. this incident will be reported

    初次使用遇到了使用无法使用sudo的问题,提示说是xxx is not the sudoers file. this incident will be reported.

    原因:linux默认没有开启sudo权限。

    解决办法:

    1>、进入root模式。输入su命令 输入root密码,进入root用户模式

 2>、添加文件的写权限。输入命令"chmod u+w /etc/sudoers"。 
3>、编辑/etc/sudoers文件。输入命令"vi /etc/sudoers",输入"i"进入编辑模式,在这行:"root ALL=(ALL) ALL"下面起一行添加"xxx ALL=(ALL) ALL"(这里的xxx是你的用户名),保存(Esc键,然后":wq")退出。
4>、撤销文件的写权限。也就是输入命令"chmod u-w /etc/sudoers"。 问题解决!!

你可能感兴趣的:(sudo)