7

为什么不建议直接修改sudoer文件?

 1 year ago
source link: https://zhangyiming748.github.io/post/why_visudo/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

为什么不建议直接修改sudoer文件?

2023-04-08 Linux

编辑/etc/sudoers文件
第一行会显示This file MUST be edited with the 'visudo' command as root.

查询stack overflow后总结有两类原因

  1. visudo在编辑保存后可以检查文件语法错误,如果出现错误文件不会被更新,防止文件编辑错误后sudo权限错误,导致没有任何用户能再次编辑sudoer文件
  2. 编辑文件时加锁,防止多个进程同时编辑sudoer文件,导致文件错乱
评论基础模式加载中。如需完整体验请针对 disq.us | disquscdn.com | disqus.com 启用代理并 尝试完整 Disqus 模式 | 强制完整 Disqus 模式
加载更多评论

Powered by  & DisqusJS


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK