Help lost my Admin user, and none on Mac now?

Discussion in 'macOS High Sierra (10.13)' started by MrMister111, Oct 5, 2017.

  1. MrMister111 macrumors 68030

    Joined:
    Jan 28, 2009
    Location:
    UK
    #1
    running a fresh install of High Sierra. For some reason it was my full name and home folder had all lower case.

    I went to settings, accounts, right clicked on my name that was an admin user, I changed the home and user name to just my first name, beginning capital.

    I then restarted my computer and my full name only log on screen was there. Logged on fine, but now there is no admin user on the Mac! and it hasn't changed to just my first name....oops what have I done? It won't let me add a user as need admin, and I've used the old one but won't let me, as its disappeared.

    Anyone help before I have to do a fresh install again please?
    thanks
     
  2. Septercius, Oct 5, 2017
    Last edited: Oct 5, 2017

    Septercius macrumors member

    Joined:
    Oct 5, 2017
    Location:
    UK
    #2
    I had this too (so I registered to post this reply). The initial lower case letter is annoying, so I tried the same thing as you and it somehow changed my administrative user to a standard one (with no way of restoring things). It did this again when I reinstalled (and then again).

    Follow the steps here to trick the Mac into rerunning the initial setup wizard:

    http://www.hackmac.org/tutorials/how-to-create-a-new-administrator-account/

    Once you've done this and rebooted, use the setup wizard to create another - temporary - administrative user and use that account to change your original user account back to an administrator and change the home folder and account name via System Preferences. When that is complete, delete the temporary administrator account and all should be well.

    Strangely, the behaviour for home folder names and account names works differently in System Preferences compared to the setup wizard, and you can change things without messing other things up.

    This is a particularly annoying bug that I'm surprised Apple hasn't picked up on before. I've successfully changed my account's name and home folder when logged in as that account in older versions of macOS, but evidently it's something that's broken in High Sierra.

    Edit: I have raised a bug report for this with Apple.
     
  3. MrMister111 thread starter macrumors 68030

    Joined:
    Jan 28, 2009
    Location:
    UK
    #3
    Appreciate the time you've took? It's helped!! Thanks.

    Exact same as you've described above symptoms.

    Sure in Sierra my home name had a capital letter and High Sierra now hasn't? Since when has your name ever started with a lower case letter???

    I'm now back as an admin user and I'll delete the other.

    Thanks for that appreciate time and links etc
     
  4. MrMister111 thread starter macrumors 68030

    Joined:
    Jan 28, 2009
    Location:
    UK
    #4
    Well just tried to rename account name with a capital and done it again....oops
     
  5. Septercius macrumors member

    Joined:
    Oct 5, 2017
    Location:
    UK
    #5
    I think the key is not to rename same account that you're logged in as (which did previously work, as I did it after getting my new iMac back in July, prior to the High Sierra upgrade). So create a temporary account and make the change to the original account from there and delete the temporary account afterwards.

    I'm still mystified as to why no-one at Apple has picked up on this before. Do they all use accounts with initial lower case letters? Weird.
     
  6. MrMister111 thread starter macrumors 68030

    Joined:
    Jan 28, 2009
    Location:
    UK
    #6
    Ah so if I log on with the new Admin, or another user I make an Admin, I can rename the account names, and my home folder I can change to a capital starting letter?
    --- Post Merged, Oct 5, 2017 ---
    tried and didn't work, still have small first letter, think I'll leave it for now....Is everybody's like this on High Sierra?
     
  7. toru173 macrumors 6502

    Joined:
    Apr 5, 2007
    #7
    The short name - the name for your home folder - is (typically) all lower case. It can be anything, but I've seen instances where upper case or spaces in the name can break things. The short name is what gets used for a lot of low level, BSD or POSIX style things.

    Best practise with macOS is to have your account name something that looks nice to you ("Mr Mister"), but have your short name something that makes sense to the computer ("mrmister").

    As for why it's breaking, if you change the name of your home folder after creating it macOS may try to create a default user that matches your login name. I don't know - I've never tried to break macOS in that specific way. I try to leave my home folder alone, because there's no place like ~!
     
  8. Septercius macrumors member

    Joined:
    Oct 5, 2017
    Location:
    UK
    #8
    If you're logging in as account A to change account B's name, that'll work. If you log in as A to change A, or B to change B, that's when it'll break.

    You can definitely have a user account with an upper case letter as its first character. If you were to visit my house, you would see that.

    1. Install High Sierra. Create your user account ("A") as you do so. Yes, it'll have an initial lower case letter.
    2. Once you're logged in as that user, use System Preferences to create an additional administrative user ("B").
    3. Log off as "A". Reboot if you want to be especially sure.
    4. Log on as "B".
    5. Using the Finder, navigate to "/Users" and rename the home folder of user "A". It'll probably prompt for confirmation and ask you to enter your password.
    6. Go into System Preferences, unlock, select "A" from the list, right-click and choose "Advanced Options" or whatever it is.
    7. Make changes to the account name.
    8. Choose the folder you renamed in step 5 for the home folder.
    9. Save the changes.
    10. Reboot (to be safe).
    11. Log in as "A".
    12. In the terminal, type "whoami" (without quotes) and "echo $HOME" and you should see the changes have taken effect.
    13. Go back into System Preferences.
    14. Delete user "B".
    15. Have a lie down.

    I've been using OS X/macOS since 2006 and I have never had any problems with my home folder name or user name having an initial upper case letter. It's only in recent versions that Apple has made this change in the initial setup assistant.

    Why should any software care what case the letters are in a folder name? As a programmer by profession myself, that smacks of shoddy coding. If it can't cope with Latin alphabet upper case characters, I shudder to think how bad things are for Chinese or Japanese characters.
     
  9. toru173 macrumors 6502

    Joined:
    Apr 5, 2007
    #9
    I agree, it's usually some piece of software that isn't written correctly - sometimes even my own software! I got into the nasty habit a little while back of casting all command line args to lower case, which works fine for my setup but is very much NOT portable.
     
  10. Ubercooper macrumors newbie

    Joined:
    Nov 6, 2017
    #10
    I too somehow made my admin account into standard account and now my Macbook air doesn't have any admin acc. and when in single user mode i type the command:
    /sbin/mount -uw /
    It doesn't mount it and instead gives this :
    spaceman_metazone_init:347:metazone for device 0 of size 924095 blocks (encrypted: 0-462047 unencrypted: 462047-924095)
    apfs_mount_update:17785: er: mount check: ro->rw update: no encryption rolling in progress,bailing.
    Can anyone help pls .
     
  11. Kindleman macrumors newbie

    Joined:
    Jan 22, 2018
    #11
    Looking at the date this was posted, you've probably either solved this or completely reinstalled. For the sake of everyone else, I had the same issue recently and found a fix. It'll take a couple reboots, so be ready to spend some time.

    I might add that I had your specific response-I'm guessing it's because my drive was encrypted-and I couldn't find much documentation on how to supply the mount command with the password.

    Here's what I did to get my admin privileges back:
    1. Write down your username. It's often the same as your home directory. Then boot into recovery mode by holding Cmd-R at startup.
    2. Open Disk Utility. It'll show a list of drives. Select your drive and click Mount. Enter your disk password and the drive will be accessible to the recovery system.
    3. Quit Disk Utility. Open Terminal from the "Utilities" Menu.
    4. Focus Terminal on your HD. Change Macintosh HD to whatever your hard drive is labeled:
    Code:
    cd /Volumes/Macintosh\ HD/
    5. Change the permissions of the sudoers file:
    Code:
    chmod etc/sudoers 777
    6. Edit yourself as a sudo user *PLEASE be very careful during this step*:
    Code:
    vi etc/sudoers
    a. Use the down arrow to find the empty line under this entry:
    Code:
    # User privilege specification
    root    ALL=(ALL) ALL
    %admin    ALL=(ALL) ALL
    b. Press the “A” key to insert text, then type the following on a new line, replacing ‘username’ with your username. *Press "TAB" between username and ALL*
    Code:
    username ALL=(ALL) ALL
    c. Hit the “ESC” (escape) key to stop editing the file.
    d. Hit the : key (colon) and then type “wq” followed by the Return key to save changes and exit vi.
    7. Restore file privileges to sudo:
    Code:
    chmod etc/sudoers 440
    8. Restart your Mac and login. Open Terminal.
    9. Add yourself to the admin group. Replace username with yours. It'll ask for an admin password after you hit return:
    Code:
    sudo dscl . -append /Groups/admin GroupMembership username
    10. Check out system preferences to confirm. You may need to restart to reload the privileges.

    Hope this helps!
     
  12. Septercius macrumors member

    Joined:
    Oct 5, 2017
    Location:
    UK
    #12
    I raised a bug report with Apple about this (shortly before downgrading to Sierra, where I remain) and supposedly it has been fixed in the latest 10.13.4 beta.
     
  13. toru173 macrumors 6502

    Joined:
    Apr 5, 2007
    #13
    Are you able to share the bug report? It seems odd - I've only ever come across the issue twice, and had to force a reinstall both times as I was unable to create new user accounts. In both instances it was before High Sierra was released
     
  14. popeye9299 macrumors newbie

    Joined:
    Sep 16, 2014
    #14

    Thanks so much, saved me a lot of heartache! I had to type
    Code:
     chmod 777 etc/sudoers
    for it to work though.
     
  15. dalkoman14 macrumors newbie

    Joined:
    Feb 9, 2018
    #15
    Can you send me the picture of the screen to make sure i am doing it right???
    --- Post Merged, Feb 9, 2018 ---
    What should i do after i enter the HD code it says it does not exist? And do we have to log in into account to run the recovery mode or not? Thank you so much!
     
  16. Oikio macrumors newbie

    Joined:
    Jun 5, 2018
    #16
    Thank you Kindleman, saved me quite a headache!
     
  17. toru173 macrumors 6502

    Joined:
    Apr 5, 2007
    #17
    I don't want to add too much to an older thread, but I've been able to get around this successfully now following these steps:

    - boot to single user mode
    - mount the disk
    - execute "launchctl load /System/Library/LaunchDaemons/com.apple.opendirectoryd.plist"
    - execute "passed root" to enable to root user. At the next prompt, choose and repeat a password for the root user
    - execute "exit"

    The system boots as normal, but will allow you to log in as root. From there you can edit user permissions as normal. Once you have regained access using your regular account, you can disable the root user from Directory Utility.

    Hope this helps!
     

Share This Page

16 October 5, 2017