ruebenramirez / blog

My blog
http://blog.ruebenramirez.com/
7 stars 0 forks source link

Mac OS X and adding users to groups #359

Open ruebenramirez opened 7 years ago

ruebenramirez commented 7 years ago

omg this is a crazy long command:

sudo dseditgroup -o edit -a $username_to_add -t user admin

source: http://superuser.com/a/214311

ruebenramirez commented 7 years ago
dseditgroup(8)            BSD System Manager's Manual           dseditgroup(8)

NAME
     dseditgroup -- group record manipulation tool.

SYNOPSIS
     dseditgroup [options] [parameters] groupname

                 options:
                       -o operation   perform (read, create, delete, edit, checkmember) operation with given groupname
                       -p             prompt for authentication password
                       -q             disables interactive verification
                       -v             verbose logging to stdout

                 parameters:
                       -m member      username to use for checkmember option
                       -n nodename    directory node location of group record
                       -u username    authenticate with admin username
                       -P password    authentication password
                       -a recordname  name of the record to add
                       -d recordname  name of the record to delete
                       -t recordtype  type of the record to add or delete
                       -T grouptype   type of group to create or modify
                       -L             maintain ComputerLists in parallel with ComputerGroups
                       -i gid         gid to add/replace
                       -g guid        GUID to add/replace
                       -S sid         SID to add/replace
                       -r realname    realname to add/replace
                       -k keyword     keyword to add
                       -c comment     comment to add/replace
                       -s timetolive  seconds to live to add/replace
                       -f n | l       change the group's format - 'n' for the new group format and 'l' for the legacy group format