Ubuntu sudo不用输入密码的方法

在启动时进入安全模式,这时是用root登录的,执行:

chmod 740 /etc/sudoers 

然后打开/etc/sudoers这个文件,把最后一行:

# User privilege specification
root    ALL=(ALL:ALL)  ALL

# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL

改为 

# User privilege specification
root    ALL=(ALL:ALL)  ALL

# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) NOPASSWD:ALL

 保存退出。 

执行: 

chmod 0440 /etc/sudoers 

完成

posted @   童年的回忆  阅读(219)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
如果本博客解决了您的问题,可以微信支付宝打赏鼓励一下作者哦,在此表示感谢
点击右上角即可分享
微信分享提示