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
发布评论
评论(2)
使用 /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
man sudoers
是你的朋友。 它解释了有关NOPASSWD
和 sudoers 文件的所有内容,您应该使用visudo
编辑该文件。man sudoers
is your friend. It explains all aboutNOPASSWD
and the sudoers file, which you should edit withvisudo
.