macos – 终端sudo或su在Mountain Lion OS X中要求输入密码

我不知道我的系统上的root密码,我正在尝试启动Apache.

$sudo apachectl start

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

– – – – 要么 – – – – – –

$sudo su apachectl start

(结果相同)

我的用户帐户是管理员帐户.这是翻新的MacBook Pro – 对我来说是新的.

最佳答案
这是Mac的标准行为,即使用户位于Administrators组中也是如此.密码是您的用户帐户的密码,而不是root帐户(默认情况下通常是禁用的). OS X在许多情况下要求您输入密码,而不仅仅是在使用sudo时.

如果您忘记了用户帐户密码,可以使用reset it following Apple’s instructions.

转载注明原文:macos – 终端sudo或su在Mountain Lion OS X中要求输入密码 - 代码日志