mkgroup 명령어 (AIX 5.3·6.1)

핵심 정리

  • 새 그룹을 만듭니다. mkgroup 그룹 또는 mkgroup 속성=값 ... 그룹. 예: mkgroup id=3001 users=app1,app2 adms=app1 appgrp.
  • -a는 관리 그룹(admin=true)으로 만들며 root나 GroupAdmin 권한이 있어야 합니다. -A는 실행한 사람을 그룹 관리자로 정합니다.
  • 그룹 ID 충돌 검사는 mkuser와 같이 /etc/security/login.cfg의 dist_uniqid로 제어합니다.
  • 그룹 이름 규칙은 사용자 이름과 같습니다: -, +, @, ~로 시작하지 않고, : " # , = \ / ? ' 백쿼트, 공백을 쓰지 않습니다.
  • 그룹의 속성은 chgroup, 구성원 추가·삭제는 chgrpmem이나 chuser groups=로 합니다.
항목 내용
버전 AIX 5.3, AIX 6.1 (6.1에서 EFS 그룹 키 저장소 생성과 반환 코드 3 안내가 더해짐)
원문 IBM Commands Reference — 5.3 Volume 3, 6.1 Volume 3
파일 /usr/bin/mkgroup, /etc/group, /etc/security/group
관련 명령어 chgroup, lsgroup, rmgroup, chgrpmem, mkuser, efskeymgr

목적

새 그룹을 만듭니다.

영어 원문

Creates a new group.

구문

text
mkgroup [ -R load_module ] [ -a ] [ -A ] [ Attribute=Value ... ] Group

설명

mkgroup 명령은 새 그룹을 만듭니다. Group 매개변수는 고유한 문자열이어야 하며(길이는 관리자가 chdev로 정함), ALL이나 default 키워드는 쓸 수 없습니다. 기본으로 일반 그룹을 만들고, 관리 그룹을 만들려면 -a를 줍니다. 관리 그룹은 root나 GroupAdmin 권한이 있는 사용자만 만들 수 있습니다.

다른 식별·인증(I&A) 메커니즘으로 그룹을 만들려면 -R로 I&A 로드 모듈을 지정합니다. 로드 모듈은 /usr/lib/security/methods.cfg에 정의됩니다.

Web-based System Manager(wsm)의 Users 응용 프로그램이나 SMIT 빠른 경로 smit mkgroups로도 실행할 수 있습니다.

mkgroup은 늘 대상 그룹 레지스트리에서 새 그룹의 ID가 고유한지 검사합니다. 시스템 속성 dist_uniqid(/etc/security/login.cfg의 usw 스탠자, chsec으로 관리)로 시스템의 모든 그룹 레지스트리를 검사하게 할 수도 있습니다.

dist_uniqid 값 뜻
never 대상이 아닌 레지스트리와의 ID 충돌은 검사하지 않음(기본)
always 다른 모든 레지스트리와의 충돌을 검사하고, 충돌이 있으면 생성·변경이 실패
uniqbyname 다른 모든 레지스트리와의 충돌을 검사하되, 이름이 같은 기존 계정과의 충돌은 허락

대상 레지스트리 안의 ID 충돌 검사는 늘 합니다. uniqbyname은 레지스트리가 둘일 때 잘 동작하며, 셋 이상이고 이미 충돌이 있으면 세 번째 레지스트리에 그 ID로 만들 때의 동작은 검사 순서에 따라 달라집니다. 충돌 검사는 로컬과 원격, 원격끼리의 고유성만 보장하며, 닿을 수 없는 원격 레지스트리는 건너뜁니다.

(6.1) EFS(암호화 파일 시스템)가 켜져 있으면 /etc/security/group에 EFS 속성을 넣습니다(명령줄에 없으면 기본값). efs_keystore_access=none을 주지 않았고 구성원 가운데 하나라도 키 저장소가 있으면 그룹 키 저장소를 만듭니다. 반환 코드가 3이면 그룹은 만들었지만 그룹 키 저장소는 만들지 못한 것으로, 나중에 efskeymgr로 만들 수 있습니다.

그룹 이름 제한

로그인이 꼬이지 않도록 대문자로만 된 그룹 이름은 피합니다. 멀티바이트 이름을 지원하지만 POSIX 이식 가능 파일 이름 문자 집합만 쓰기를 권합니다.

그룹 이름은 -, +, @, ~로 시작하면 안 되고, ALL과 default 키워드도 쓸 수 없습니다. 또 :(콜론), "(큰따옴표), #(샵), ,(쉼표), =(등호), \(백슬래시), /(슬래시), ?(물음표), '(작은따옴표), 백쿼트를 쓰지 않으며, 공백·탭·줄바꿈 문자도 쓸 수 없습니다.

영어 원문

The mkgroup command creates a new group. The Group parameter must be a unique string (whose length is administrator-configurable by way of the chdev command) and cannot be the ALL or default keywords. By default, the mkgroup command creates a standard group. To create an administrative group, specify the -a flag. You must be the root user or a user with GroupAdmin authorization to create an administrative group.

To create a group with an alternate Identification and Authentication (I&A) mechanism, the -R flag can be used to specify the I&A load module used to create the group. Load modules are defined in the /usr/lib/security/methods.cfg file.

You can use the Users application in Web-based System Manager (wsm) to change user characteristics. You could also use the System Management Interface Tool (SMIT) smit mkgroups fast path to run this command.

The mkgroup command always checks the target group registry to make sure the ID for the new account is unique to the target registry. The mkgroup command can also be configured to check all group registries of the system using the dist_uniqid system attribute. The dist_uniqid system attribute is an attribute of the usw stanza of the /etc/security/login.cfg file, and can be managed using the chsec command.

The dist_uniqid system attribute has the following values:

  • never - Does not check for ID collision against the non-target registries. This is the default setting.

  • always - Checks for ID collision against all other registries. If collision is detected between the target registry and any other registry account creation or modification fails.

  • uniqbyname - Checks for ID collision against all other registries. Collision between registries is allowed only if the account to be created has the same name as the existing account.

Note: ID collision detection in the target registry is always enforced regardless of the dist_uniqid system attribute.

The uniqbyname system attribute setting works well against two registries. With more than two registries, and with ID collision already existing between two registries, the behavior of the mkgroup command is unspecified when creating a new account in a third registry using the colliding ID values. The new account creation might succeed or fail depending the order in which the registries are checked.

The check for ID collision only enforces ID uniqueness between the local registry and remote registries or between remote registries. There is no guarantee of ID uniqueness between the newly created account on the remote registry and existing local users on other systems that make use of the same remote registry. The mkgroup command bypasses a remote registry if the remote registry is not reachable at the time the command is run.

If Encrypted File System (EFS) is enabled on the system, the mkgroup command updates the /etc/security/group file with EFS attributes (default values are added if you do not specify the attributes on the command line). If you do not specify efs_keystore_access=none, the mkgroup command creates the group keystore if at least one of the users has a keystore.

If the mkgroup command returns with the return code of 3, the keystore for the group is not created, but the mkgroup command creates the group.

Note: You can later create the group keystore by using the efskeymgr command.

Restrictions on Creating Group Names

To prevent login inconsistencies, you should avoid composing group names entirely of uppercase alphabetic characters. While the mkgroup command supports multibyte group names, it is recommended that you restrict group names to characters with the POSIX portable filename character set.

To ensure that your user database remains uncorrupted, you must be careful when naming groups. Group names must not begin with a - (dash), + (plus sign), @ (at sign), or ~ (tilde). You cannot use the keywords ALL or default in a group name. Additionally, do not use any of the following characters within a group-name string:

  • : — Colon
  • " — Double quote
  • # — Pound sign
  • , — Comma
  • = — Equal sign
  • \ — Back slash
  • / — Slash
  • ? — Question mark
  • ' — Single quote
  • ' — Back quote

Finally, the Name parameter cannot contain any space, tab, or new-line characters.

플래그

플래그 설명
-a 관리 그룹을 만듭니다. root만 쓸 수 있습니다.
-A 명령을 실행한 사람을 그룹 관리자로 정합니다.
-R load_module 그룹을 만들 때 쓸 로드 가능한 I&A 모듈.
Attribute=Value 그룹 속성을 초기화합니다. 속성은 chgroup을 봅니다.
영어 원문
  • -a — Creates an administrative group. Only the root user can use this flag.
  • -A — Sets the group administrator to the person who invoked the mkgroup command.
  • -R load_module — Specifies the loadable I&A module used to create the user.
  • Attribute=Value — Initializes a group with a specific attribute. See the chgroup command for more information about the group attributes.

종료 상태

값 뜻
0 성공했고 요청한 변경을 모두 함
0보다 큼 오류. 출력된 오류 메시지에 실패 내용이 자세히 나옴
영어 원문

This command returns the following exit values:

  • 0 — The command runs successfully and all requested changes are made.
  • >0 — An error occurred. The printed error message lists further details about the type of failure.

보안

접근 제어: 이 명령의 실행(x) 권한은 root와 security 그룹 구성원에게만 줘야 합니다. 신뢰 컴퓨팅 기반(TCB) 프로그램으로 설치하고, root가 소유하며 setuid(SUID) 비트를 켜 둬야 합니다.

RBAC 사용자와 Trusted AIX 사용자는 주의하세요. 이 명령은 특권 작업을 할 수 있으며, 특권 작업은 특권 사용자만 할 수 있습니다. 특권과 권한 목록은 lssecattr 명령이나 getcmdattr 하위 명령으로 봅니다(6.1 문서에만 있음). 명령의 기능을 모두 쓰려면 역할에 accessauths 말고도 aix.security.group.change 권한이, EFS가 켜져 있으면 그룹 키 저장소를 만들 aix.security.efs 권한이 있어야 합니다.

읽고 쓰는 파일: /etc/passwd, /etc/security/user, /etc/security/limits, /etc/security/environ, /etc/group, /etc/security/group(읽기·쓰기), /usr/lib/security/mkuser.default(읽기), /usr/lib/security/mkuser.sys(실행).

감사 이벤트: USER_Create(사용자).

영어 원문

Access Control: This command should grant execute (x) access only to the root user and members of the security group. This command should be installed as a program in the trusted computing base (TCB). The command should be owned by the root user with the setuid (SUID) bit set.

Attention RBAC users and Trusted AIX users: This command can perform privileged operations. Only privileged users can run privileged operations. For more information about authorizations and privileges, see Privileged Command Database in Security. For a list of privileges and the authorizations associated with this command, see the lssecattr command or the getcmdattr subcommand. To get the full functionality of the command, besides the accessauths, the role must also have the aix.security.group.change authorization. If Encrypted File System (EFS) is enabled on the system, the role must also have the aix.security.efs authorization to create the group keystore.

Files Accessed:

Mode File rw /etc/passwd rw /etc/security/user rw /etc/security/limits rw /etc/security/environ rw /etc/group rw /etc/security/group r /usr/lib/security/mkuser.default x /usr/lib/security/mkuser.sys

Auditing Events:

Event Information USER_Create user

Limitations

모든 로드 가능한 I&A 모듈이 그룹 생성을 지원하지는 않습니다. 지원하지 않으면 오류를 보고합니다.

영어 원문

Creating a group may not be supported by all loadable I&A modules. If the loadable I&A module does not support creating a group, an error is reported.

예제

명령 하는 일
mkgroup finance 그룹 finance를 만듦
mkgroup -a payroll 관리 그룹 payroll을 만듦(root만)
mkgroup -A managers 그룹 managers를 만들고 자신을 관리자로
mkgroup adms=steve,mike managers 그룹 managers를 만들고 관리자를 steve, mike로(두 사용자가 이미 있어야 함)
mkgroup -R LDAP monsters LDAP I&A 모듈 그룹 monsters를 만듦

자주 쓰는 형태:

bash
mkgroup id=3001 appgrp                  # GID를 정해 만들기(클러스터 노드끼리 맞출 때)
chgrpmem -m + app1,app2 appgrp          # 구성원 더하기
lsgroup -a id users appgrp
영어 원문
  1. To create a new group account called finance, type: mkgroup finance

  2. To create a new administrative group account called payroll, type: mkgroup -a payroll

Only the root user can issue this command.

  1. To create a new group account called managers and set yourself as the administrator, type: mkgroup -A managers

  2. To create a new group account called managers and set the list of administrators to steve and mike, type: mkgroup adms=steve,mike managers

The users steve and mike must already exist on the system.

  1. To create a new group that is a LDAP I&A loadable module user, type: mkgroup -R LDAP monsters

파일

파일 설명
/usr/bin/mkgroup mkgroup 명령
/etc/group 그룹의 기본 속성
/etc/security/group 그룹의 확장 속성
/etc/passwd 기본 사용자 정보
/etc/security/passwd 비밀번호 정보
영어 원문
  • /usr/bin/mkgroup — Contains the mkgroup command.
  • /etc/group — Contains the basic attributes of groups.
  • /etc/security/group — Contains the extended attributes of groups.
  • /etc/passwd — Contains basic user information.
  • /etc/security/passwd — Contains password information.

Related reference:

  • mkuser Command

Related information:

  • chgrpmem command
  • passwd command
  • Trusted AIX®

PowerHA SystemMirror Administration Guide

리눅스(GNU)와 다른 점

리눅스에서는 useradd·usermod·userdel(또는 Debian 계열의 adduser), groupadd·groupmod·groupdel, passwd, chage(비밀번호 만료), id·getent passwd 이름(조회)을 씁니다. AIX의 /etc/security/user처럼 사용자별 보안 속성을 한 파일에 두지 않고, 비밀번호 정책은 /etc/login.defs와 PAM(pam_pwquality, pam_faillock), 자원 한도는 /etc/security/limits.conf에 둡니다. mkgroup에 해당하는 것은 groupadd -g 3001 appgrp이고, 구성원은 gpasswd -a 사용자 그룹이나 usermod -aG 그룹 사용자로 더합니다.