遇到这样的情况就是说明当前用户没有在sudoers里面
[bluez@localhost ~]$ 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 文件中。此事将被报告。
[bluez@localhost ~]$
具体的添加步骤如下:
1 先修改sudoers的配置文件,但是这个文件在平时是没有写权限的,所以添加写权限;
chmod u+w /etc/sudoers
2 接着找到这一 行:”root ALL=(ALL) ALL”在起下面添加”bluez ALL=(ALL) ALL”(这里的bluez是我的用户名),然后保存退出。
3 最后撤销文件的写权限,
chmod u-w /etc/sudoers