question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

taking away admin rights using cli command doesn't work

See original GitHub issue

I ran sudo dscl . -delete /Groups/admin GroupMembership myaccount

rebooted but when I open the shell I can still run sudo su - and when I look at the myaccount user it is still listed as Admin in the Users & groups config and id myaccount shows up with

uid=501(myaccount) gid=20(staff) groups=20(staff),12(everyone),61(localaccounts),79(_appserverusr),80(admin),81(_appserveradm),98(_lpadmin),701(com.apple.sharepoint.group.1),33(_appstore),100(_lpoperator),204(_developer),395(com.apple.access_ftp),398(com.apple.access_screensharing),399(com.apple.access_ssh)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
JensTimmermancommented, Dec 13, 2016

Turns out I’m still in the group because my UUID is still in the group

root#  dscl . -read /users/myaccount | grep GeneratedUID
GeneratedUID: XXXXXXXX-YYYY-ZZZZ-WWWW-QQQQQQQQQQQQ
 dscl . -read /Groups/admin GroupMembers
GroupMembers: FFFFEEEE-DDDD-CCCC-BBBB-AAAA00000000 XXXXXXXX-YYYY-ZZZZ-WWWW-QQQQQQQQQQQQ XXXXXXXX-YYYY-ZZZZ-WWWW-PPPPPPPPPPPP

This command really removed me from the admin group:

 dscl . -delete /Groups/admin GroupMembers  XXXXXXXX-YYYY-ZZZZ-WWWW-QQQQQQQQQQQQ

Sudo no longer works, and I’m shown as a Standard user in the Users & Groups settings panel.

So you might have to add this command to your guide.

(found this out thanks to https://superuser.com/questions/279891/list-all-members-of-a-group-mac-os-x/395738#395738 )

0reactions
JensTimmermancommented, Dec 13, 2016

and because of SIP I can’t dtruss dsmemberutil, dscl and dscacheutil 😦

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to remove administrator rights Command ... - YouTube
Removing administrator privileges means to remove admin user from local administrators group. You can use command prompt to remove admin ...
Read more >
How to add adminstrator rights using command prompt ...
Adding admin privileges or admin rights to user account is actually adding a user to a local administrators group. You can do it...
Read more >
Fix Can't Run CMD as Administrator in 7 Easy Steps
First, Right-click your desktop, select New and then click on Shortcut. Command Prompt admin won't open Windows 10 · In the text field,...
Read more >
How to Remove Admin Rights without Reducing Productivity
A guide to the risks associated with admin rights and over-privileged users, and how to remove admin rights in order to reduce those...
Read more >
Force a program to run *without* administrator privileges or ...
Note that if the admin privileges are due to a trustinfo entry in a manifest, obviously this will not work. – user1258361. Dec...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found