苹果的OS X是一款基于UNIX内核的操作系统,熟悉*NIX的用户可以很快的上手。
可是OS X下默认的管理员账号在Terminal中并不具有root权限,很多操作无法实现(如重启apache)
有两种简便的方法可以开启root账号
1) 直接在Terminal中输入 sudo -s
然后输入管理员密码即可
CODE
Dash:~ dash$ sudo -s
We trust you have received the usual lecture from the local System Administrator. It usually boils down to there two things:
? ? ? ? ? ? ? #1) Respect the privacy of others.
? ? ? ? ? ? ? #2) Think before you type.
We trust you have received the usual lecture from the local System Administrator. It usually boils down to there two things:
? ? ? ? ? ? ? #1) Respect the privacy of others.
? ? ? ? ? ? ? #2) Think before you type.
Password:
Dash:~ root#
2) 打开 Applecations->Utilities->Netinfo Manager,在菜单中选择“安全”->“开启root账号”

系统会提示设置root密码,设置成功后就可以在Terminal中通过login来登录到root账号了。