代码改变世界

XXX is not in the sudoers file

2017-06-08 15:12  彭大先生  阅读(254)  评论(0编辑  收藏  举报

当sudo执行命令的时候 报“xxx is not in the sudoers file”,意思是当前用户没有sudo权限,解决办法很简单

切换到root用户,然后visudo,把xxx用户加进去

1.  su root

2.  visudo

增加

## Allow xxx to run any commands anywhere
xxx    ALL=(ALL)       ALL

visudo 然后查找 ALL,可以找到

## Allow root to run any commands anywhere
root    ALL=(ALL)       ALL

按照格式把xxx加进去就可以了。

---

加进去之后,记得su xxx切换回用户