# Admin Login difficulties



## mchang99 (Jan 22, 2013)

Hi my MacBook is malfunctioning and I need help. 
I rebooted the computer but when the login came
back there was only a guest option. I don't have the 
Guest password and then also the computer
will only let me access a secure Internet portal. 
I don't know how to access my admin password to get 
into my computer.


----------



## Headrush (Feb 9, 2005)

mchang99 said:


> then also the computer
> will only let me access a secure Internet portal.


Not sure what that means.

Can you login into single user mode?
(Hold the command and 'S' keys as the machine starts)


----------



## mchang99 (Jan 22, 2013)

Sorry let me clear. I have lost all access to my computer. I have no Admin account the guest says my passowrd doesn't work. I have lost all my files everything is gone. I can only get online from a secure safari web browser which I'm using right now. I just want to be able to get my files back and access the admin privilges. 
I do have access to safe mode but the problem is I don't know what to do when I get there. I do also have a start up disc that I used to no avail but read somewhere I could reset passowrds but I have no password to enter so resetting it would be useles.


----------



## Headrush (Feb 9, 2005)

From that single user command line, can you navigate to where your files should be and are they there?


```
cd /Users/yourUserName
ls -l
```
Change _yourUserName_ to the name of your login account.

You should get lines like this

```
drwx------+  6 scott  staff   204 20 Jan 12:41 Desktop
```
Make note of the user and group values. (In the above example they are scott and staff)


----------



## mchang99 (Jan 22, 2013)

Thanks but I don't just want access to my files but the whole computer again. What good is changing login passwords if I don't get access to it when I login in the first place. Guest is the only option upon startup also the computer keeps asking for my Safari keychain password. I have no idea what this is as I have never used one in the past.


----------



## Headrush (Feb 9, 2005)

mchang99 said:


> Thanks but I don't just want access to my files but the whole computer again.


I wasn't asking so you could just access the files.
The point was to see if the user account and directory still exists, otherwise trying to restore it and which way to proceed would be point less.



mchang99 said:


> What good is changing login passwords if I don't get access to it when I login in the first place.


I don't recall ever saying anything about changing any passwords.



mchang99 said:


> Guest is the only option upon startup also the computer keeps asking for my Safari keychain password. I have no idea what this is as I have never used one in the past.


There is no magic bullet to just instantly restore it from the GUI.


----------



## mchang99 (Jan 22, 2013)

Sorry I'm very frustrated with my computer now but I am very grateful that you are helping me resolves this issue. What is the next step what do I do when I get to get command line. Please keep in mind I have very little experience with this stuff so be very descrptive


----------



## Headrush (Feb 9, 2005)

If you look at post #4 above, it's posted in a code block.

Just replace yourUserName with what your user account name was.

You can also do the following in single user mode:

```
mount -uw /
rm /var/db/.applesetupdone
reboot
```
When the computer reboots, it should start the OS X Setup Assistant.

Create a new admin account as instructed but make sure *you choose a different username than your previous account.*

The results you post from the first steps will tell us the next step. (restoring the old account)

*Extra Bonus info for all*: Having your normal user account not as an admin account is best, but like others I run mine as administrator also.
In these cases, having a second administrator account is a good practice, so when something like this happens, you still have a working GUI account with admin privileges.


----------



## mchang99 (Jan 22, 2013)

Sorry Headrush I asked some friends and they said I shouldn't mess around in Single User Mode. I am not comfortable with that level of computer hacking is there another less evasive ways of solving my problem and restoring my Admin account?


----------



## Headrush (Feb 9, 2005)

mchang99 said:


> Sorry Headrush I asked some friends and they said I shouldn't mess around in Single User Mode. I am not comfortable with that level of computer hacking is there another less evasive ways of solving my problem and restoring my Admin account?


No offense but not sure how knowledgable your friends are with this stuff or if you showed them what I suggested.

We aren't really hacking around in single user mode.
That is just a single command and the remaining steps are all done in the GUI.

If you don't want to do it this way, I'm afraid I don't know any other ways.

P.S. You never answered my post #4 where we need to check to make sure your old account is even there.
Those commands listed there are all non-destructive commands, they just print information and in no way can hurt your system.


----------



## mchang99 (Jan 22, 2013)

Ok I will try it so do I enter all the code in from the first line. One after another. 

From that single user command line, can you navigate to where your files should be and are they there?

Code:
cd /Users/yourUserName
ls -l
Change yourUserName to the name of your login account.

You should get lines like this
Code:
drwx------+ 6 scott staff 204 20 Jan 12:41 Desktop
Make note of the user and group values. (In the above example they are scott and staff)

If you look at post #4 above, it's posted in a code block.

Just replace yourUserName with what your user account name was.

You can also do the following in single user mode:
Code:
mount -uw /
rm /var/db/.applesetupdone
reboot
When the computer reboots, it should start the OS X Setup Assistant.

Also I don't even know if my original files exist because I found a install disc. I pressed C and when the computer booted up. I looked under passwords there wasn't any admin account.


----------



## Headrush (Feb 9, 2005)

mchang99 said:


> Also I don't even know if my original files exist because I found a install disc. I pressed C and when the computer booted up. I looked under passwords there wasn't any admin account.


That is what I want to check first.
Booting from the DVD and looking under passwords doesn't tell us anything useful. (The files can still be there.)

Boot to single user mode and just post the results of running this one simple command:

```
ls -l /Users/
```
If you see your account listed, do the following also while in single user mode:

```
mount -uw /
rm /var/db/.applesetupdone
reboot
```
When the computer reboots, it should start the OS X Setup Assistant.

Create a new admin account as instructed but make sure you choose a *different* username than your previous account.

Once that is done you should be logged into the GUI using that new user account.

Now go to System Preferences -> Users & Groups and click the '+' icon to create a new account.
Name this account the *exact* same as your old account. OS X should prompt you saying that the user folder already exists. Choose the option to use the existing folder.

Your old account should be restored.
You can delete that new account you created earlier, or keep it as a safety backup admin account in case problems like this happen again.


----------



## mchang99 (Jan 22, 2013)

I have my computer back now thanks, however I couldn't reload my old account when the computer rebooted its only allowed me to start over. I tried to reload a previous image file from my the time machine backup however the computer was full and couldn't accept the entire backup. The point is I have my computer back and will now try and find my old files piece by piece. 

Thanks again, 

Your Friend
D

PS: If you have any suggestions as to how I can find my old files I'm all ears.


----------



## Headrush (Feb 9, 2005)

mchang99 said:


> however I couldn't reload my old account when the computer rebooted its only allowed me to start over.


This was normal. It wasn't re-installing, just creating a new user and setting up files for first time (even though it wasn't).

Not sure exactly what you did with Time Machine but it sounds like you did something wrong. If you are restoring a single user account it shouldn't take additional space unless you tried archiving the old copy still there.

Confused at what you did or where you are at.
So did you do the command I said in single user mode and finished the startup wizard when it rebooted and created a new user account?
If no, what did you do otherwise?

If you go into Finder -> Devices in left sidebar -> Your computer Name -> Your Hard disk name -> Users, you should see your accounts including your old one. (assuming its there, you never posts the results I asked for  ).

If it's there you can go into that folder and drag files you need into your new user account. (Open a second Finder window for this, just drag and drop)


----------



## mchang99 (Jan 22, 2013)

I enter SUM and typed all the commands you told me to type and then when it rebooted the computer started acting like it was fresh out of the box. 

Sorry I also tried to copy the text from the SUM but couldn't figure out how to copy the output from the code ls -l

One of the options upon start up was to restore from time machine. I thought this option was best since I didn't know what was going to happen when I rebooted without the backup.

Also when I rebooted I couldn't remember the original name of the computer and the ls -l didn't tell me anything other than random files on my computer. 

When I tried to reboot the computer said their was already a user with that name and it wouldn't let me proceed without changing names. Upon looking at the User file it seems I have created to accounts. My old one is still there and the new one that was created just now.


----------



## mchang99 (Jan 22, 2013)

I enter SUM and typed all the commands you told me to type and then when it rebooted the computer started acting like it was fresh out of the box. 

Sorry I also tried to copy the text from the SUM but couldn't figure out how to copy the output from the code ls -l

One of the options upon start up was to restore from time machine. I thought this option was best since I didn't know what was going to happen when I rebooted without the backup.

Also when I rebooted I couldn't remember the original name of the computer and the ls -l didn't tell me anything other than random files on my computer. 

When I tried to reboot the computer said their was already a user with that name and it wouldn't let me proceed without changing names. Upon looking at the User file it seems I have created to accounts. My old one is still there and the new one that was created just now.


----------



## Headrush (Feb 9, 2005)

Thanks, now I understand.

Restoring from Time Machine wasn't the best decision but sounds like you still might be OK.

Can you start /Applications -> Utilities -> Terminal and type

```
ls -l /Users/
```
and post the result? (You should be able to copy and paste the output now)


----------

