linux下,一般用戶運行sudo命令時會出現錯誤提示:
如vurtne is not in the sudoers file. This incident will be reported.
這里,vurtne是一般用戶名稱,然后導致無法執行sudo命令,這時候,如下解決:
這里,vurtne是一般用戶名稱,然后導致無法執行sudo命令,這時候,如下解決:
1. 進入超級用戶模式,也就是用root登錄系統。
2. 給/etc/sudoers文件添加寫入權限:chmod u+w /etc/sudoers
3. 編輯/etc/sudoers文件。
vim /etc/sudoers
在root ALL=(ALL) ALL
下面添加vurtne ALL=(ALL) ALL(這里的vurtne換成你的用戶名),然后保存退出。
4.撤銷/etc/sudoers文件的寫入權限:chmod u-w /etc/sudoers
然后一般用戶就可以正常使用sudo命令了。