xxx is not in the sudoers file解決方法

用sudo時提示"xxx is not in the sudoers file. This incident will be reported.其中XXX是當前用戶名,也就是當前用戶沒有權限使用sudo,只要修改一下/etc/sudoers文件就行了。修改方法:

1) su -

2)chmod u+w /etc/sudoers
3)vi /etc/sudoers,  找到這一 行:"root ALL=(ALL) ALL" 在起下面添加"xxx ALL=(ALL) ALL"(這裏的xxx是用戶名),保存退出。
4)chmod u-w /etc/sudoers

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章