Use of groupadd for user and group management on the command line interface

Source: Internet
Author: User

Use of groupadd for user and group management on the command line interface

Groupadd-create a new group

The groupadd command is used to create a new group.

Syntax
Groupadd [options] group

Option:
-H for help

-G: create a user group with the specified GID

-P: Specify the group password when creating the group

-R -- system: creates a system user with the UID ranging from 1 to 499.

-O, -- non-unique allows repeated groups to be created

-F when creating a group, if the group exists, it also exits successfully.

-K, -- key KEY key = VALUE
Overrides/etc/login. defs defaults (GID_MIN, GID_MAX and
Others). Multiple-K options can be specified.

Example:-K GID_MIN = 100-K GID_MAX = 499

Note:-K GID_MIN = 10, GID_MAX = 499 doesn't work yet.

I don't know why the-K option is used? Explanations

 

The following is an example.

# Groupadd xiao1

# Cat/etc/group | tail-1

Xiao1: x: 4039: information of the created group xiao1

# Groupadd-g 4040 xiao1

Groupadd: group 'xiao1' already exists creation failed

# Groupadd-g 4039 xiao2

Groupadd: GID '000000' already exists creation failed

# Groupadd-g 4040-o-f xiao1 created successfully

# Groupadd-g 4039-o-f xiao2 created successfully

Note: When-o-f is used together, a non-unique group can be created successfully. What are the benefits of doing so when I am a little white? Explanations

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.