rmgroup 명령어 (AIX 5.3·6.1)

핵심 정리

  • 그룹과 그 속성을 지웁니다. rmgroup 그룹. 구성원 사용자는 지우지 않습니다.
  • 어떤 사용자의 주 그룹(pgrp)이면 지울 수 없습니다. 먼저 chuser pgrp=다른그룹 사용자로 바꿉니다.
  • 관리 그룹이나 관리 사용자가 구성원인 그룹은 root나 GroupAdmin 권한이 있어야 지웁니다.
  • -p(6.1)는 EFS 그룹 키 저장소도 지웁니다. LDAP 그룹은 -R LDAP을 줍니다.
  • 그 그룹이 소유한 파일은 GID 숫자로 남으므로 find / -group 그룹으로 미리 확인합니다.
항목 내용
버전 AIX 5.3, AIX 6.1 (6.1에서 -p(그룹 키 저장소 삭제)가 더해짐)
원문 IBM Commands Reference — 5.3 Volume 4, 6.1 Volume 4
파일 /usr/sbin/rmgroup, /etc/group, /etc/security/group
관련 명령어 mkgroup, chgroup, lsgroup, chuser, rmuser

목적

그룹을 지웁니다.

영어 원문

Removes a group.

구문

text
rmgroup [ -p ] [ -R load_module ] Name

-p는 6.1 구문에만 있습니다.

설명

rmgroup 명령은 Name 매개변수로 지정한 그룹을 지웁니다. 그룹의 모든 속성도 지웁니다. 그룹 이름이 있어야 합니다. 그룹 구성원인 사용자는 시스템에서 지우지 않습니다.

그룹이 어떤 사용자의 주 그룹이면, chuser로 그 사용자의 주 그룹을 바꾸기 전에는 지울 수 없습니다(chuser는 /etc/passwd를 고칩니다). 관리 그룹이나 관리 사용자가 구성원인 그룹은 root나 GroupAdmin 권한이 있는 사용자만 지울 수 있습니다.

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

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

영어 원문

The rmgroup command removes a group specified by the Name parameter. This command deletes all the group attributes as well. To remove a group, the group name must already exist. Users who are group members are not removed from the system.

If the group is the primary group for any user, you cannot remove it unless you redefine the user's primary group with the chuser command. The chuser command alters the /etc/passwd file. Only the root user or a user with GroupAdmin authorization can remove an administrative group or a group with administrative users as members.

For groups that were created with an alternate Identification and Authentication (I&A) mechanism, the -R flag can be used to specify the I&A load module used. 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 rmgroup fast path to run this command.

Flag

플래그 설명
-p 그룹 키 저장소를 지웁니다. 6.1부터
-R load_module 그룹을 지울 때 쓸 로드 가능한 I&A 모듈.
영어 원문
  • -p — Removes the group keystore.
  • -R load_module — Specifies the loadable I&A module used to remove a group.

종료 상태

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

This command returns the following exit values:

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

보안

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

읽고 쓰는 파일: /etc/passwd(읽기), /etc/group, /etc/security/group(읽기·쓰기).

감사 이벤트: GROUP_Remove(그룹).

RBAC 사용자와 Trusted AIX 사용자는 주의하세요. 이 명령은 특권 작업을 할 수 있으며, 특권 작업은 특권 사용자만 할 수 있습니다. 특권과 권한 목록은 lssecattr 명령이나 getcmdattr 하위 명령으로 봅니다(6.1 문서에만 있음).

영어 원문

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.

Files Accessed:

Mode File r /etc/passwd rw /etc/group rw /etc/security/group

Auditing Events:

Event Information GROUP_Remove group

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.

Limitations

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

영어 원문

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

예제

명령 하는 일
rmgroup finance 그룹 finance를 지움
rmgroup -R LDAP monsters LDAP I&A 모듈 그룹 monsters를 지움

자주 쓰는 형태:

bash
lsuser -a pgrp ALL | grep "pgrp=appgrp"   # 이 그룹을 주 그룹으로 쓰는 사용자
find / -xdev -group appgrp -ls 2>/dev/null
rmgroup appgrp
영어 원문
  1. To remove the finance group, type: rmgroup finance

  2. To remove the LDAP I&A loadable module group monsters, type: rmgroup -R LDAP monsters

파일

파일 설명
/usr/sbin/rmgroup rmgroup 명령
/etc/group 그룹의 기본 속성
/etc/security/group 그룹의 확장 속성
영어 원문
  • /usr/sbin/rmgroup — Contains the rmgroup command.
  • /etc/group — Contains the basic attributes of groups.
  • /etc/security/group — Contains the extended attributes of groups.

Related reference:

  • passwd Command
  • rmuser Command

Related information:

  • chfn command
  • mkuser command
  • Securing the network

리눅스(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에 둡니다. rmgroup에 해당하는 것은 groupdel 그룹이며, 리눅스도 주 그룹으로 쓰이는 그룹은 지울 수 없습니다.