MacPorts 升级后失去以 sudo 身份运行的能力
我最近将 MacPorts 从 1.9.2 升级到 2.0.3。从那时起,我就失去了以 sudo 身份运行的能力。
sudo: can't stat /opt/local/etc/sudoers: No such file or directory
sudo: no valid sudoers sources found, quitting
不确定这些是否相关,但我想知道目前最好的行动方案是什么。
port Installation 返回
sudo @1.7.4p2_0
sudo @1.7.7_0 (active)
进一步调查表明我安装了 MacPorts 的 sudo,但没有附带 /opt/local/etc/sudoers 文件。我已经设法使用 visudo 创建这样一个文件,复制 /etc/sudoers 的内容,chmod 到 0440 并将所有权复制到 root:wheel。
我想现在的问题是我应该使用MacPorts的sudo还是卸载它?我最后是如何安装 MacPorts 的 sudo 的呢?
I recently updgraded MacPorts from 1.9.2 to 2.0.3. Since then, I've lost the ability to run as sudo.
sudo: can't stat /opt/local/etc/sudoers: No such file or directory
sudo: no valid sudoers sources found, quitting
Unsure if these are related, but I'm wondering what the best course of action is at this point.
port installed returns
sudo @1.7.4p2_0
sudo @1.7.7_0 (active)
Further investigation suggests I've installed MacPorts' sudo without an accompanying /opt/local/etc/sudoers file. I've managed to create such a file using visudo, copying the content of /etc/sudoers, chmod to 0440 and ownership to root:wheel.
I guess the question now is whether I should use MacPorts' sudo or uninstall it? And how did I end up with installing the MacPorts' sudo?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我自己不是 Mac 用户,但请查看此页面:
http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man5/sudoers.5.html
...还有一个外观visudo 的手册页,用于编辑 sudoers 文件:
http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man8/visudo.8.html#//apple_ref/doc/man/8/visudo
Not a Mac man myself, but have a look at this page:
http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man5/sudoers.5.html
...and also a look at the man page for visudo, which is used to edit the sudoers file:
http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man8/visudo.8.html#//apple_ref/doc/man/8/visudo