添加當前使用者到sudoers裡面
阿新 • • 發佈:2019-01-02
遇到這樣的情況就是說明當前使用者沒有在sudoers裡面
[[email protected] ~]$ sudo ifconfig
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.
[sudo] password for bluez:
bluez 不在 sudoers 檔案中。此事將被報告。
[[email protected] ~]$
具體的新增步驟如下:
1 先修改sudoers的配置檔案,但是這個檔案在平時是沒有寫許可權的,所以新增寫許可權;
chmod u+w /etc/sudoers
2 接著找到這一 行:”root ALL=(ALL) ALL”在起下面新增”bluez ALL=(ALL) ALL”(這裡的bluez是我的使用者名稱),然後儲存退出。
3 最後撤銷檔案的寫許可權,
chmod u-w /etc/sudoers