Saturday, July 16, 2011

AIX group administration - mkgroup

Creating a group in AIX is simple and straightforward. The same restrictions for creating a user pertain to creating a group:
  • Groups cannot start with the:
    • Dash or minus sign (-).
    • Plus sign (+)
    • At symbol (@)
    • Tilde (~)
  • Groups cannot be named ALL or default, as these names are reserved to the operating system.
  • Group names cannot include:
    • Colon (:)
    • Quotation marks—single or double (' or ")
    • Pound or hash sign (#)
    • Comma (,)
    • Equal sign (=)
    • Slashes—back or forward (\ or /)
    • Question mark (?)
    • Back quote or tick (`)
    • White space (space or tab)
    • New-line characters
  • Group names can only be eight characters or less in AIX version 5.2 and earlier. Starting with AIX version 5.3, IBM increased the maximum number of characters to 255.
Both user and group name lengths are handled by the same parameter: v_max_logname. To view or change the value, follow the instructions provided for viewing and changing the user name length in mkuser, earlier in this article.
To create a group, simply execute the mkgroup command with the group name as an argument, as shown in Listing.

Listing Create a group with mkgroup

# mkgroup atctest

# grep atctest /etc/group

# grep -p atctest /etc/security/group
        admin = false

To create an admin group, add the -a switch, as shown in Listing.

Listing Create an admin group

# mkgroup -a atcadmin

# grep atcadmin /etc/group

# grep -p atcadmin /etc/security/group
        admin = true

To create a group and add Xander as the administrator of the group, add the adm section of the /etc/security/group stanza to the command line, as shown in Listing.

Listing Add a specific user as a group administrator

# mkgroup adms=xander xangroup

# grep xangroup /etc/group

# grep -p xangroup /etc/security/group
        admin = false
        adms = xander

Like mkusermkgroup follows the same attributes as chgroup. For a full list of the attributes, read chgroup's man page (man chgroup).

No comments:

Post a Comment