1. 用root运行命令visudo。
添加 your_user_name ALL=(ALL) ALL
2.可以/etc/sudoers添加普通用户权限,加一行就OK了。
NOPASSWD字符串可以另你在使用sudo的时候不用输入密码。
##
## User privilege specification
##
root ALL=(ALL) ALL
## Uncomment to allow members of group wheel to execute any command
# %wheel ALL=(ALL) ALL
username ALL=(ALL) NOPASSWD: ALL
From: http://blog.csdn.net/zhuqinglu/article/details/2050927
From: http://www.cnblogs.com/evasnowind/archive/2011/02/04/1949113.html
From: http://www.cnblogs.com/xiangzi888/archive/2012/03/13/2393444.html