how to reset mac root password
Reset 10.5 Leopard & 10.6 Snow Leopard password
- Power on or restart your Mac.
- At the chime (or grey screen if your chime is turned off), hold down Command+S on your keyboard to enter single-user mode.
- This step is optional, but it’s a good idea because it checks the consistency of the hard disk before moving on. At the prompt, type fsck -fy and press Enter/Return. Wait for the checks to complete before going to the next step.
- Type mount -uw / and press Enter.
- Type launchctl load /System/Library/LaunchDaemons/com.apple.DirectoryServices.plist and press Enter.
- Type ls /Users and press Enter. This lists all of the usernames on the computer – helpful if you don’t know or remember what these are.
- Type dscl . -passwd /Users/username password and replace “username” with one of the users displayed in the previous step. Replace “password” with a new password of your choice. Press Enter.
- Type reboot and press Enter.
Reset 10.4 Tiger password
- Power on or restart your Mac.
- At the chime (or grey screen if your chime is turned off), hold down Command+S on your keyboard to enter single-user mode.
- Type sh /etc/rc and press Enter/Return.
- Type passwd username and replace “username” with the short name of the user account for which you’d like to reset the password.
- Type your desired password and press Enter. It won’t show itself on the screen, so be careful what you type. You will most likely have to enter it again to confirm.
- Type reboot and press Enter.
Tricking your Mac into creating a new user account
- Power on or restart your Mac (should work for any Mac OS X system).
- At the chime (or grey screen if your chime is turned off), hold down Command+S on your keyboard to enter single-user mode.
- This step is optional, but it’s a good idea because it checks the consistency of the hard disk before moving on. At the prompt, type fsck -fy and press Enter/Return. Wait for the checks to complete before going to the next step.
- Type mount -uw / and press Enter.
- Type rm /var/db/.AppleSetupDone and press Enter.
- Type shutdown -h now and press Enter.
The third method of resetting your Mac’s password requires some additional explanation. Rather than simply changing the password like the previous two methods do, this one fools the operating system into believing it has never been started before. This means when you restart the machine, it will take you through the entire setup & registration process all over again. Do not worry, all of your pre-existing data is still available. Just continue with this process and do not choose the option to transfer or migrate information to the Mac.
Once you’re done, log in with your new admin account and go to System Preferences > Accounts. You may have to click on the lock icon in the lower-left corner before making changes here. You should see your original user account(s) in the left column. Try clicking on one of them to convert it to a standard user account (uncheck “Allow user to administer this computer”) and change the password. You should be able to successfully log in to that account now and access all of your files and programs. If you want, you can log back in with your new admin account and re-check the “Allow user to administer this computer” option in System Preferences to grant admin privileges to the original user again.
That should cover it! As always, remember messing with single-user mode and Terminal is risky and may lead to trouble if you make mistakes. Considering you’re already locked out of the computer, though, you’ll probably be willing to take your chances at this point.
One last thing… if you have a Keychain Access password, you will probably need to reset that as well. You can do this by selecting “login” under Keychains on the left and choosing Delete from the Edit menu. You’ll lose everything in the Keychain, but you’ll now be able to start fresh and add new ones.
Reset password using Lion Recovery
If you bought a brand new Mac with Lion pre-installed, the hard drive includes with a recovery partition that gives you access to a bunch of different tools. Here’s how to take advantage of this utility to reset your Mac’s password:
- Shut down your Mac and turn it back on while holding down the Command and R keys at the same time until you see the Lion Recovery screen.
- From the menu bar at the top, select Utilities > Terminal.
- In the Terminal window type resetpassword and press Enter.
- Use the Reset Password utility to select your hard drive, choose your user account, and enter a new password.
Reset Lion password with Single User mode
Anyone running Mac OS X Lion can take advantage of this method:
- Shut down your Mac and turn it back on while holding down the Command and S keys at the same time until your see a black screen with white text. This is known as Single User mode.
- You can skip this step, but it’s recommended that you don’t because it will check the consistency of your hard drive. At the prompt, type fsck -fy and press Enter.
- Once the disk check is complete and the prompt returns, type mount -uw / and press Enter.
- Type launchctl load /System/Library/LaunchDaemons/com.apple.opendirectoryd.plist and press Enter.
- Type ls /Users and press Enter. All of the usernames on the computer will be listed, which is helpful if you don’t know or remember what these are.
- Type dscl . passwd /Users/username password while replacing username with one of the users displayed in the previous step and replacing password with the new password of your choice. Press Enter. You will likely get an error message about a file or directory not being found – it’s safe to ignore this.
- Type reboot and press Enter.
how to reset mac root password的更多相关文章
- Mac环境下mysql初始化密码问题--If you lose this password, please consult the section How to Reset the Root Password in the MySQL reference manual.
个人在Mac上操作数据库,遇到的启动数据库问题的简单记录 1.苹果->系统偏好设置->最下边点mysql 在弹出页面中 关闭mysql服务(点击stop mysql server) 2.进 ...
- Reset GitLab Root Password
重置gitlab管理员密码 Log into your server with root privileges. Then start a Ruby on Rails console. Start t ...
- Linux - Reset a MySQL root password
Use the following steps to reset a MySQL root password by using the command line interface. Stop the ...
- mysql forget root password
http://www.rackspace.com/knowledge_center/article/mysql-resetting-a-lost-mysql-root-password MySQL - ...
- MYSQL更改root password时遇到Access Denied的解决办法
今天在公司虚拟机上装MYSQL之后需要修改root password,然而遇到这样的错误: Access denied for user 'root'@'localhost' (using passw ...
- mysqladmin -u root password
ERROR : Error appeared during Puppet run: 192.77.108.242_mysql.ppError: mysqladmin -u root password ...
- MYSQL安装时解决要输入current root password的解决方法
在装MYSQL的时候发现要输入current root password不记得以前在电脑里装过(你的系统曾经装过MYSQL在重装就会要求输入原来设定的密码,如果是第一次安装就不会出现),在网上苦苦搜寻 ...
- centos7开机出现try again to boot into default maintenance give root password for maintenance
开启centos7出现下面两句话,然后直接输出root密码,就可以登录,但是登录后,发现一些文字显示出来的是乱码 try again to boot into default maintenanceg ...
- linux系统无法启动,提示give root password for maintenance错误
电脑的虚拟机安装的是centos6.2操作系统,今天打开虚拟机时候,提示 give root password for maintenance (or type control-D to contin ...
随机推荐
- 【linux 命令】:查看系统开机,关机时间【转载】
转载原文:http://www.cnblogs.com/kerrycode/p/3759395.html 看Linux开机关机时间的方法(非常全面) 1: who 命令查看 who -b 查看最后一次 ...
- Fedora 防火墙关闭与开启
重启后生效 开启: chkconfig iptables on 关闭: chkconfig iptables off 或者 /sbin/chkconfig --level 2345 iptable ...
- 笔记 《Effective Objective-C 2.0:编写高质量iOS与OS X代码的52个有效方法 》
阅读此书的笔记点: 此书目录即是对知识点最好的总结 第1章 熟悉Objective-C ---------------------------------------------- 第1条:了解Obj ...
- Windows CPU占用率过高
今天调试程序,发现Windows7的CPU占用率一直为25%左右,如下图所示.四核25%,换成单核那就是100%的占用率了! 上图进入"进程"页面,单击"CPU" ...
- 编译spock proxy
今天把spock proxy编译通过并且运行了.大家如果在编译这款类似于MySQL proxy的软件遇到问题时,可以联系我.微信onesoft007
- Spring表达式语言 之 5.4在Bean定义中使用EL(拾伍)
5.4.1 xml风格的配置 SpEL支持在Bean定义时注入,默认使用"#{SpEL表达式}"表示,其中"#root"根对象默认可以认为是Applicati ...
- struts2 token 使用说明
使用token标签的时候,Struts2会建立一个GUID(全局唯一的字符串)放在session中,并且会成为一个hidden放在form中. token拦截器会判断客户端form提交的token和s ...
- Azure平台 对Twitter 推文关键字进行实时大数据分析
Learn how to do real-time sentiment analysis of big data using HBase in an HDInsight (Hadoop) cluste ...
- 纯css3代码写九宫格效果
主要用到css3中的transition和布局知识.代码如下 <!DOCTYPE html> <html lang="en"> <head> & ...
- 面试时,问哪些问题能试出一个 Android 应用开发者真正的水平?【转自知乎】
这几年面过的各种Android开发也有三位数了,failed的不敢说,pass的基本都没有看走眼,来得晚了也想说说我的体会. 一般面试时间短则30分钟,多则1个小时,这么点时间要全面考察一个人难度很大 ...