0

macOS High Sierra (10.13.6)

How to login again in Users and Groups Also before with old username, I could access sudo. How to gain back sudo access. I went into Users and Groups --> Unlocked successfully --> Changed Account Name --> Restarted mac.

  • tried to get sudo access to one of the hidden files. got error [myname] is not in the sudoers file. This incident will be reported.
  • cant logo in my Users and Groups again

I have also tried su -, vi /etc/sudoers, sudo -v, sudo dscl .

-merge /Groups/admin GroupMembership <username>
Password:
<username> is not in the sudoers file.  This incident will be reported.

Also tired

dscl . -append /groups/admin GroupMembership USERNAME
<main> attribute status: eDSPermissionError
<dscl_cmd> DS Error: -14120 (eDSPermissionError)

ok just found out i have two users

 su OLACCOUNTNAME
    bash-3.2$ sudo dscl / -append /Groups/admin GroupMembership OLACCOUNTNAME
    OLACCOUNTNAME is not in the sudoers file.  This incident will be reported.
dscl . -read /groups/admin GroupMembership
GroupMembership: root


su NEWACCOUNTNAME
Password:
su: Sorry

*It never asked me to change password or add a new one for this user.

su OLDACCOUNTNAME
id -a
uid=501(OLDACCOUNTNAME) gid=20(staff) groups=20(staff),701(com.apple.sharepoint.group.1),12(everyone),61(localaccounts),100(_lpoperator)

dscl . list /Users | grep -v '_'
daemon
blindshot
nobody
root
  • Also, did you rename the only Admin user on your system? If you run id -a is the user still part of the admin group? – nohillside Apr 19 '20 at 07:59
  • yes id -a it shows the old account name in uid=501(blindshot) gid=20(staff) groups=20(staff),701(com.apple.sharepoint.group.1),12(everyone),61(localaccounts),100(_lpoperator) – Blindshot Apr 19 '20 at 08:13
  • See https://apple.stackexchange.com/questions/164331/i-dont-have-administrator-account-on-my-mac. This should allow you to create a new admin user and get access again. If you need help in cleaning up the blindshot account, please ask a new question for this. – nohillside Apr 19 '20 at 08:48

0 Answers0