問題描述
使用普通用戶登錄后在終端中執(zhí)行sudo命令時(shí)提示以下錯(cuò)誤:
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
解決方法
一熟妓、 切換到root用戶
終端中執(zhí)行 su
命令,然后輸入密碼囊扳,從普通用戶切換為根用戶
二轧邪、為sudoers配置文件添加寫權(quán)限
sudoers文件位于 /etc
目錄下血崭,其為系統(tǒng)配置sudo用戶的一個(gè)只讀配置文件萍虽。在root身份下執(zhí)行 chmod +w /etc/sudoers
命令為該文件添加寫權(quán)限情竹。
三堪藐、編輯sudoers配置文件
執(zhí)行 vi /etc/sudoers
命令對(duì)配置文件進(jìn)行編輯届榄。在文件中先找到
Allows people in group wheel to run all commands
這段配置浅乔,然后在配置下方新起一行添加所需要增加 sudo
權(quán)限的用戶,格式如下
用戶名 ALL=(ALL) ALL