Previous Section  < Day Day Up >  Next Section

Recipe 8.11. Adding Groups with groupadd

8.11.1 Problem

You need to create some new user or system groups. Any server programs that you install should have their own users and group.

8.11.2 Solution

Use groupadd.

This command creates a new group, using the system values configured in /etc/default/useradd and /etc/skel/:

# groupadd newgroup

You can create a system group with -r flag:

# groupadd -r newgroup

The -r flag is a Red Hat-specific option. If your version of groupadd does not have it, you'll have to specify the next available system group number:

# groupadd -g 127 newgroup

Look in /etc/group to see the next available group number.

8.11.3 Discussion

It's a good idea to stick to a consistent group numbering scheme. Linux doesn't care, for the most part, but for your own sanity it's essential. Red Hat system groups are 0-499; Debian's are 100-999. See the "Discussion" section in Recipe Recipe 8.2 for more information on numbering schemes.

8.11.4 See Also

  • groupadd(8)

    Previous Section  < Day Day Up >  Next Section