Ubuntu下is not in the sudoers file 問題解決

在Ubuntu12.04 下,使用sudo apt-get install XXX 時,突然跳出 username is not in the sudoers file的問題


然後我一查此username的類型,果然是標準用戶而不是管理員用戶

解決這個問題至少有兩種方法:


一。System Settings ->User Accounts -> 點擊Unlock ->輸入root密碼 -> 修改AccountType(用戶類型)爲Administrator(管理員) -> 重啓



root用戶下,修改/etc/sudoers的權限爲640(chmod 640 /etc/sudoers) -> vim /etc/sudoers -> 找到root ALL=(ALL:ALL) ALL ->添加

username ALL=(ALL:ALL) ALL -> 修改/etc/sudoers的權限爲440(chmod 440 /etc/sudoers)-> 重啓


這時我知道的兩種方法,若有其他方法,請大神留言告之。

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