Results 1 to 7 of 7

Thread: Create new group in Apple Mac OS

  1. #1
    Join Date
    Dec 2009
    Posts
    292

    Create new group in Apple Mac OS

    Hello,
    I'm looking to create a group under mac os x from command line, but does not groupadd (obviously this is a Mach kernel, not linux). So my question is how to build you one in a group CLI? Any help regarding this is appreciated. Thanks in advance.

  2. #2
    Join Date
    Nov 2009
    Posts
    518

    Add new group in Mac OS X

    Hello,
    I think this must be done via
    Code:
    sudo niutil-create / / groups / group_name 
    sudo-niutil createprop / / groups / group_name gid_number gid
    Is best to look in NetInfo what is to be added as other properties for a group. I think this should work, just give it a try.

  3. #3
    Join Date
    Mar 2010
    Posts
    182

    Re: Create new group in Apple Mac OS

    Hello,
    I needed to create a group and add a user. If someone wants to do the same thing, exactly what I had to do that it works.
    Example:
    My files and backups are on an external hard drive and all these files have been created from Linux. These files / folders were part of the group "norris" with rights rwxrwxr-x (775). I wanted to keep those rights to allow write access only to people in my group. Under MacOS X, I'm not the creator of the files / folders and I'm not part of the group entitled to access. Suddenly I could not write, edit or delete my files / folders. So what may the solution for this. Thank you for your help.

  4. #4
    Join Date
    Nov 2009
    Posts
    356

    Add group in Mac OS and Linux

    Hello,
    Here are commands you have to use in Terminal (Spotlight> Terminal)
    First, you can type the command "id". This command allows you to know, among other groups where you are.
    Code:
    my-user: ~ $ id uid = temp 510 (temp) gid = 123 (chuck) groups = 123 (chuck)
    uid (user identification) shows me the ID of my user. 
    GID (group identifier) tells me the ID of my Main group.
    groups tells me all the groups to which I belong.

  5. #5
    Join Date
    Nov 2009
    Posts
    446

    Re: Create new group in Apple Mac OS

    Hello,
    You can use the following also
    Code:
    sudo dscl. create / groups / gid temp 1000
    sudo because I must have administrative rights. Here, I created the group norris with the gid 1000(if I did not state the gid, it does not group). To be sure that the gid 1000is not, check in the file "/ etc / groups". Be sure the new gid does not exist in this file.
    Code:
    sudo dscl. merge / groups / users temp user
    Here, I give an additional group temp . It is now part of the group user. This can be verified with the command id.
    Code:
    my-user: ~ $ id uid = temp 510 (temp) gid = 123 (chuck) groups = 123 (chuck), 1000 (user)
    This is a brand new MacBook Pro running Mac OS X 10.5.8, and I have nothing installed to run these commands.

  6. #6
    Join Date
    Dec 2009
    Posts
    296

    Re: Create new group in Apple Mac OS

    Hello,
    Well done to "/ etc / group". It's true that my group was not added in / etc / group .. I would expect all the default groups that are created based? Anyway, since I created a group with the command dscl, I have a section "Groups" in "System Preference> Account ".. And I see the group that I created. I can also add, delete and modify groups. I do not recall having seen it before.

  7. #7
    Join Date
    Nov 2009
    Posts
    583

    Re: Create new group in Apple Mac OS

    Hello,
    To my knowledge, since Leopard, there is more utility to manage system groups, it must pass through the terminal.
    To view all groups:
    Code:
    sudo dscl. list / Groups 
    To view all the GID of each group, either: 
    sudo dscl. list / Groups PrimaryGroupID 
    sudo dscl. list / Groups gid
    I hope the information will help you.

Similar Threads

  1. How create a group sales agreement template in Excel
    By Shaina Na in forum Windows Software
    Replies: 3
    Last Post: 08-01-2012, 01:31 PM
  2. Replies: 2
    Last Post: 15-11-2011, 02:45 AM
  3. How to create new group on PGP Universal Server 3.1.2
    By McKenzie in forum Networking & Security
    Replies: 6
    Last Post: 06-06-2011, 05:51 AM
  4. Replies: 3
    Last Post: 24-02-2011, 11:25 PM
  5. How to create, delete and set up the Home Group
    By Fullmoon in forum Networking & Security
    Replies: 4
    Last Post: 15-01-2011, 04:34 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,751,782,000.52072 seconds with 16 queries