linux系统使用sudo命令报xxx is not in the sudoers file.This incident will be reported.的解决方法
linux-dash
A beautiful web dashboard for Linux
项目地址:https://gitcode.com/gh_mirrors/li/linux-dash
·
在使用sudo命令前时,用户确保在sudoers文件中已添加xxx ALL=(ALL) ALL (这里的xxx是你的用户名),否则
会报xxx is not in the sudoers file.This incident will be reported的错误,下面说说如何解决这个错误。
1.切换root用户,在终端输入su,回车后输入root的密码即可切换到root用户
2.添加sudoers文件的写权限,命令是:chmod u+w ../etc/sudoers(若当前目录不是用户目录,则需要切换到用户目录下:cd ~)
3.编辑sudoers文件,命令是:vi ../etc/sudoers,键入i,使其处于编辑阶段,找到root ALL=(ALL) ALL,在他下面添加
xxx ALL=(ALL) ALL (这里的xxx是你的用户名),添加后如下图,按esc键后再键入:wq退出并保存即可
4.撤销sudoers文件写权限,命令:chmod u-w ../etc/sudoers,在终端完整输入的命令如下图,这样普通用户就可以使用sudo命令了
A beautiful web dashboard for Linux
最近提交(Master分支:2 个月前 )
186a802e
added ecosystem file for PM2 5 年前
5def40a3
Add host customization support for the NodeJS version 5 年前
AtomGit 是由开放原子开源基金会联合 CSDN 等生态伙伴共同推出的新一代开源与人工智能协作平台。平台坚持“开放、中立、公益”的理念,把代码托管、模型共享、数据集托管、智能体开发体验和算力服务整合在一起,为开发者提供从开发、训练到部署的一站式体验。
更多推荐



所有评论(0)