================================方法一=========================================
首先,启动机器,启动时按住Apple和S键,以单用户模式(single user mode)进入系统。输入:mount -uw / 然后回车。
输入: passwd 短用户名 (如果你知道的话)如果你不知道短用户名,可以输入: passwdroot
输入两遍新密码。
输入:reboot 回车。
让机器重新启动。
如果你用的是root,登录以后,要到系统预置/系统偏好设置(System Preferences)里的”账户”下,找到适当的用户,并修改其密码。
===========================================================================
================================方法二=========================================
这个是登陆不上系统,使用系统光盘来修改root 及用户密码。买pro的时候,根本没见光盘。
现在lion更简单直接从网上下载安装恢复了。
不实用。
==============================================================================
能登陆系统,但是忘记了root密码,修改root密码如下:
sudo bash
password:输入你的当前用户密码
bash-3.2# ok done!
其实没啥,因为登陆当前用户默认在系统sudoers的list里。
CLmatoMacBook-Pro:~ vivi$ su
Password:
su: Sorry
CLmatoMacBook-Pro:~ vivi$ sudo bash
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:
bash-3.2# id
uid=0(root) gid=0(wheel) groups=0(wheel),204(_developer),100(_lpoperator),98(_lpadmin),80(admin),61(localaccounts),29(certusers),20(staff),12(everyone),9(procmod),8(procview),5(operator),4(tty),3(sys),2(kmem),1(daemon),402(com.apple.sharepoint.group.1),401(com.apple.access_screensharing)
bash-3.2# cat /etc/sudoers
# sudoers file.
#
# This file MUST be edited with the ‘visudo’ command as root.
# Failure to use ‘visudo’ may result in syntax or file permission errors
# that prevent sudo from running.
#
# See the sudoers man page for the details on how to write a sudoers file.
#
# Host alias specification
# User alias specification
# Cmnd alias specification
# Defaults specification
Defaults env_reset
Defaults env_keep += “BLOCKSIZE”
Defaults env_keep += “COLORFGBG COLORTERM”
Defaults env_keep += “__CF_USER_TEXT_ENCODING”
Defaults env_keep += “CHARSET LANG LANGUAGE LC_ALL LC_COLLATE LC_CTYPE”
Defaults env_keep += “LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME”
Defaults env_keep += “LINES COLUMNS”
Defaults env_keep += “LSCOLORS”
Defaults env_keep += “SSH_AUTH_SOCK”
Defaults env_keep += “TZ”
Defaults env_keep += “DISPLAY XAUTHORIZATION XAUTHORITY”
Defaults env_keep += “EDITOR VISUAL”
# Runas alias specification
# User privilege specification
root ALL=(ALL) ALL
%admin ALL=(ALL) ALL
# Uncomment to allow people in group wheel to run all commands
# %wheel ALL=(ALL) ALL
# Same thing without a password
# %wheel ALL=(ALL) NOPASSWD: ALL
# Samples
# %users ALL=/sbin/mount /cdrom,/sbin/umount /cdrom
# %users localhost=/sbin/shutdown -h now
bash-3.2#
顺便推荐下如何提高从app store 下载速度的文章:http://www.3haow.com/1ios-app/201107/772.html