sudo: /etc/sudoers is mode 0640, should be 0440解决办法
ubuntu或者CentOS中,/etc/sudoer 的权限为 0440时才能正常使用,否则sudo命令就不能正常使用。出现类似:sudo: /etc/sudoers is mode 0640, should be 0440 的对话。
解决办法:
1、Ctrl+Alt+F1 进入文本模式。用超级用户登录,如root
2、输入:chmod 0440 /etc/sudoers 。Enter
3、exit 退出
4、Ctrl+Alt+F7 返回图形模式。
5、在试试sudo命令,可以用了
P:其实另开一个端口,su -进入root,然后chmod 0440 /etc/sudoers
效果是一样的
example:
[BIngo@windows ~]$ sudo chmod u+w /etc/sudoers
口令:
[BIngo@windows ~]$ ls -l /etc/sudoers
-rw-r----- 1 root root 3210 11-16 02:40 /etc/sudoers
[BIngo@windows ~]$ sudo chmod u-w /etc/sudoers
sudo: /etc/sudoers is mode 0640, should be 0440
[BIngo@windows ~]$ ls -l /etc/sudoers
-rw-r----- 1 root root 3210 11-16 02:40 /etc/sudoers
口令:
[BIngo@windows ~]$ ls -l /etc/sudoers
-rw-r----- 1 root root 3210 11-16 02:40 /etc/sudoers
[BIngo@windows ~]$ sudo chmod u-w /etc/sudoers
sudo: /etc/sudoers is mode 0640, should be 0440
[BIngo@windows ~]$ ls -l /etc/sudoers
-rw-r----- 1 root root 3210 11-16 02:40 /etc/sudoers
另开端口
[root@windows ~]# chmod 0440 /etc/sudoers
[root@windows ~]# exit
[BIngo@windows ~]$ ls -l /etc/sudoers
-r--r----- 1 root root 3210 11-16 02:40 /etc/sudoers
[BIngo@windows ~]$ ls -l /etc/sudoers
-r--r----- 1 root root 3210 11-16 02:40 /etc/sudoers
分类:
Linux(ubuntu)
, Linux(centos)
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 地球OL攻略 —— 某应届生求职总结
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· .NET周刊【3月第1期 2025-03-02】
· [AI/GPT/综述] AI Agent的设计模式综述
2013-04-17 自动编译 打包 签名 android程序
2012-04-17 RenderControl (asp.net)
2012-04-17 关于SQL中CTE(公用表表达式)(Common Table Expression)的总结
2012-04-17 SQL中JOIN和UNION区别、用法及示例
2011-04-17 软件项目的质量管理(转)
2011-04-17 项目经理职业生涯
2011-04-17 软件项目质量管理实战总结(转)