I installed MacPorts on my Macbook pro with lion, restarted, and now I cannot log into my account. After the restart it hung at the loading screen (the apple with the loading icon) for a while. I restarted, booted into safemode and tried to log in. When I type in my password it appears like it's logging in (goes to a white/gray screen), but then goes right back to the screen with the accounts to choose from. I've tried looging into root as well, the same thing happens. I've tried this both in safemode and regular bootup.

I'm currently writing this from the OSX utilities page. I tried to reset my password in the utitlies boot menu by selecting terminal and typed resetpassword and I noticed that MacPorts created a user account for itself. I changed my password, restarted, and still I cannot log into my account.

I ran verify permissions and repair permissions. Still no luck logging in. I have most of my important things backed up, but there are still a few things that I'd like to get in case I do have to reinstall OSX.

  1. What else can I try to be able to log into my account?

  2. If I have no choice but to reinstall OSX, how can I back up some data?

  • What do the logs say? – Spiff May 1 '14 at 3:24
  • @Spiff what logs should I be checking and where are they located? – user3476345 May 1 '14 at 4:10
  • /var/log/system.log, or look at the entire ASL log stream by typing syslog | less. I'm assuming you can boot into single-user mode? – Spiff May 1 '14 at 5:48
up vote 1 down vote accepted

Here are a couple of things to try:

  1. There might be a problem with login items after you try and log into your account. To disable login item, hold down shift after clicking the login button. http://support.apple.com/kb/PH14215

  2. If you have ssh or remote login turned on, try accessing your account over the network.

  3. If your mac had firewire/thunderbolt, you should be able to use Target Disk mode to mount your macs HD on another mac and get files you need off that way. http://support.apple.com/kb/ht1661

Good luck.

  • I was able to install OS X lion while keeping my old profile. It's acting strange, but at least I was able to get on to back up a few things. I'm going to format and re-install. Thanks for your help. – user3476345 May 1 '14 at 19:55

This happened to me because I connected an external monitor while in stand-by then woke up the macbook. It had multiple spaces on the external monitor (all named Desktop 1) and the dashboard on the main display and couldn't change it. After disconnecting the external monitor, it logged me out and then could not login anymore, even in safe boot.

I fixed it by removing a preferences file: http://solvecomputerissues.ideacity.ro/2014/11/cannot-login-on-mac-osx-mavericks.html. From the link:

This is how you should be able to fix this in less than five minutes:

  1. Boot to single user mode by holding "⌘" and "s" while turning on from power off.
  2. Mount read/write by typing in terminal:
    /sbin/mount -uw /
  3. Move /Users/<user>/Library/Preferences/com.apple.spaces.plist somewhere else (replace with your actual username).
  4. Reboot.

You even get back the open windows as you left them before the problem.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.