"[用户名] is not in the sudoers file"(已解决)
- 发表文章
- 摘要:解决方法: 1.切换到root用户su-12.添加文件读写权限chmodu+w/etc/sudoers13.打开文件vim/etc/sudoers1注:如果没有vim,请通过apt-getinstallvim安装。4.找到rootALL=(ALL)ALL并在此行下方添加:[用户名]ALL=(ALL)ALL15.删除文件读写命令chmodu-w/etc/sudoers
解决方法:
su -
1.切换到root用户- 1
2.添加文件读写权限
chmod u+w /etc/sudoers- 1
3.打开文件
vim /etc/sudoers- 1
注:如果没有vim,请通过apt-get install vim安装。
4.找到root ALL=(ALL) ALL并在此行下方添加:
[用户名] ALL=(ALL) ALL- 1
5.删除文件读写命令
chmod u-w /etc/sudoers