如何让 sudo 保存密码?

发布于 2024-07-16 04:16:45 字数 1459 浏览 2 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

中二柚 2024-07-23 04:16:45

使用 /etc/sudoers 中的 NOPASSWD 选项。

不过,这通常是一个坏主意,因为任何在没有密码的情况下访问通过 sudo 运行命令的帐户的用户都可能会破坏系统。

另外,sudo 应该在一段时间内记住您的密码。 如果根据您的喜好,超时时间过早,您可以按照此处的说明增加超时时间: http://forums.macosxhints.com/showthread.php?t=83344

Use the NOPASSWD option in /etc/sudoers.

This is generally a bad idea, though, as any user who gets access to an account that run commands through sudo without a password may be able to compromise the system.

Also, sudo should remember your password for a period of time. If this is timing out too soon for your tastes, you can increase the timeout by following instructions here: http://forums.macosxhints.com/showthread.php?t=83344

深空失忆 2024-07-23 04:16:45

man sudoers 是你的朋友。 它解释了有关 NOPASSWD 和 sudoers 文件的所有内容,您应该使用 visudo 编辑该文件。

man sudoers is your friend. It explains all about NOPASSWD and the sudoers file, which you should edit with visudo.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文