Ale*_*ber 4 sudo passwords macos
我有一个 MacOS X Mavericks 安装,该帐户只有一个用户管理员和空密码:

现在我正在尝试安装 Cocoapods,但不能使用“sudo”,因为我不知道root密码:
admin@mac:etc> id
uid=501(admin) gid=20(staff) groups=20(staff),401(com.apple.sharepoint.group.1),12(everyone),61(localaccounts),79(_appserverusr),80(admin),81(_appserveradm),98(_lpadmin),33(_appstore),100(_lpoperator),204(_developer),398(com.apple.access_screensharing),399(com.apple.access_ssh)
admin@mac:etc> id root
uid=0(root) gid=0(wheel) groups=0(wheel),1(daemon),2(kmem),3(sys),4(tty),5(operator),8(procview),9(procmod),12(everyone),20(staff),29(certusers),61(localaccounts),80(admin),401(com.apple.sharepoint.group.1),33(_appstore),98(_lpadmin),100(_lpoperator),204(_developer),398(com.apple.access_screensharing),399(com.apple.access_ssh)
admin@mac:etc> sudo gem install cocoapods
WARNING: Improper use of the sudo command could lead to data loss
or the deletion of important system files. Please double-check your
typing when using sudo. Type "man sudo" for more information.
To proceed, enter your password, or type Ctrl-C to abort.
Password:
Sorry, try again.
Password:
Sorry, try again.
Password:
Sorry, try again.
sudo: 3 incorrect password attempts
Run Code Online (Sandbox Code Playgroud)
在 Linux 上,我会以单用户模式启动机器并设置root密码。或者将Admin用户添加到wheel groupd 并在 /etc/sudoers 中取消注释此行:
%wheel ALL=(ALL) NOPASSWD: ALL
Run Code Online (Sandbox Code Playgroud)
但是在 MacOS 中我不知道该怎么做。
当我运行文本编辑器或 MacVim 时,我也找不到 /etc/sudoers。
小智 10
直截了当,您实际上必须启用 root 用户。
1. 单击登录选项,然后单击左下角的锁定图标解锁灰色屏幕,然后加入或编辑网络帐户服务器。
2.然后选择打开目录实用程序。再次单击锁并进行身份验证。
3. 转到顶部的菜单栏,您可以选择启用 Root 用户,或者如果已启用,则更改密码。
这是一种方法。
| 归档时间: |
|
| 查看次数: |
31505 次 |
| 最近记录: |