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
sudoaccess 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.
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
id -ais the user still part of theadmingroup? – nohillside Apr 19 '20 at 07:59id -ait shows the old account name inuid=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:13blindshotaccount, please ask a new question for this. – nohillside Apr 19 '20 at 08:48