V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
justrand
V2EX  ›  问与答

sudo 配置了免密为什么切换过去还是要密码?

  •  
  •   justrand · 2022-02-08 13:56:34 +08:00 · 1068 次点击
    这是一个创建于 812 天前的主题,其中的信息可能已经有所发展或是发生改变。

    微信截图_20220208135451.png 刚开可以的,重启下后就无效了。好奇怪

    4 条回复    2022-02-09 11:07:13 +08:00
    dingwen07
        1
    dingwen07  
       2022-02-08 14:16:18 +08:00
    fsck
    acmore
        2
    acmore  
       2022-02-08 14:40:33 +08:00   ❤️ 1
    "The sudoers file is read in one pass so when multiple entries match for a user, they are applied in order. Where there are conflicting values, the last match is used (which is not necessarily the most specific match)."

    如果 vagrant 在 sudo 组里的话,那么可能是因为上边 vagrant 的配置又被 %sudo 覆盖了。把 vagrant 写在其他配置下边,或者单独放在 /etc/sudoers.d/ 里或许可以解决。
    levinit
        3
    levinit  
       2022-02-09 10:28:30 +08:00 via iPhone
    你是咋切的 sudo su
    larricane
        4
    larricane  
       2022-02-09 11:07:13 +08:00 via Android
    不要直接修改这个文件,在 /etc 下新建一个目录 sudoers.d ,创建新的文件,然后添加你的规则。登出后重新登录应该就可以了。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5200 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 08:53 · PVG 16:53 · LAX 01:53 · JFK 04:53
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.