布袋和尚_爱吃鱼

布袋和尚_爱吃鱼

Linux 用户切换 sudo su - 出现  is not in the sudoers file.  This incident will be reported-LMLPHP

这是提示说当前用户不在sudoers文件中,需要将当前用户添加到sudoers中。操作如下:

先切换到root用户:

输入root密码

sudoers 文件默认是只读的,需要赋予写的权限

Linux 用户切换 sudo su - 出现  is not in the sudoers file.  This incident will be reported-LMLPHP

找到

root    ALL=(ALL)       ALL

然后在下面一行添加 :yangjie    ALL=(ALL)     NOPASSWD:ALL

Linux 用户切换 sudo su - 出现  is not in the sudoers file.  This incident will be reported-LMLPHP

然后保存,把sudoers文件的权限退回到只读状态 如果不改为只读权限的话,你试试就知道了

然后退出root用户

现在执行 sudo su - 就可以直接切换到root下了

Linux 用户切换 sudo su - 出现  is not in the sudoers file.  This incident will be reported-LMLPHP

其实文档里也写得很清楚了,有一个大大的提示说明,哈哈哈哈

Linux 用户切换 sudo su - 出现  is not in the sudoers file.  This incident will be reported-LMLPHP

10-27 04:15