普通用户,执行不了管理员的权限。
将普通用户加入到sudoer,即可使用sudo 命令,需要以root 进行以下配置:
vi /etc/sudoers
1. 添加用户
## Allow root to run any commands anywhere
root ALL=(ALL)ALL
添加一行
cao ALL=(ALL) ALL
2.添加群组
## Allows people in group wheel to run all commands
# %wheel ALL=(ALL)ALL
%developer ALL=(ALL)ALL