lsgroup 명령어 (AIX 5.3·6.1)

핵심 정리

  • 그룹 속성을 보여 줍니다. lsgroup 그룹(하나), lsgroup ALL(모두). ALL을 꼭 줘야 합니다.
  • -a로 원하는 속성만 봅니다. 예: lsgroup -a id users adms staff(ID, 구성원, 관리자).
  • 출력 형식: 기본(한 줄에 속성=값), -f(스탠자), -c(콜론), -C(6.1).
  • 속성의 뜻은 chgroup 문서에 있습니다. 일반 사용자도 실행할 수 있지만 볼 수 없는 속성이 있을 수 있습니다.
항목 내용
버전 AIX 5.3, AIX 6.1 (6.1에서 -C(파싱하기 쉬운 콜론 형식)와 domainlessgroups 안내가 더해짐)
원문 IBM Commands Reference — 5.3 Volume 3, 6.1 Volume 3
파일 /usr/sbin/lsgroup, /etc/group, /etc/security/group
관련 명령어 mkgroup, chgroup, rmgroup, chgrpmem, lsuser

목적

그룹 속성을 보여 줍니다.

영어 원문

Displays group attributes.

구문

text
lsgroup [ -R load_module ] [ -c | -C | -f ] [ -a List ] { ALL | Group [ ,Group ] ... }

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

설명

lsgroup 명령은 그룹 속성을 보여 줍니다. 모든 시스템 그룹과 속성, 또는 특정 그룹의 모든 속성을 볼 수 있습니다. 기본 매개변수가 없으므로 모든 그룹을 보려면 ALL 키워드를 줘야 합니다. chgroup에 설명된 속성을 모두 보여 주며, 읽을 수 없는 속성이 있으면 되도록 많은 정보를 보여 주고 빈 속성은 보여 주지 않습니다. 일부 속성만 보려면 -a List를 씁니다.

(6.1) 참고: /etc/secvars.cfg에 domainlessgroups 속성이 정해져 있으면 LDAP 모듈과 LOCAL 모듈의 사용자를 함께 보여 줍니다.

기본으로 그룹마다 한 줄에, 공백으로 나눈 Attribute=Value 형식으로 보여 줍니다. 스탠자 형식은 -f, 콜론으로 나눈 레코드는 -c나 -C를 씁니다.

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

영어 원문

The lsgroup command displays group attributes. You can use this command to list all the system groups and their attributes or you can list all the attributes of individual groups. Since there is no default parameter, you must enter the ALL keyword to list all the system groups and their attributes. All the attributes that are described in the chgroup command are displayed. If the lsgroup command cannot read one or more attributes, it lists as much information as possible, but does not display empty attributes. To view a selected attribute, use the -a List flag.

Note: If the domainlessgroups attribute is set in the /etc/secvars.cfg file, the lsgroup command lists the users from the LDAP module and the LOCAL module, if present.

By default, the lsgroup command lists each group on one line. It displays attribute information as Attribute=Value definitions, each separated by a blank space. To list the group attributes in stanza format, use the -f flag. To list the information in colon-separated records, use the -c or -C flag.

You can use a Web-based System Manager Users application (wsm users fast path) to run this command. You could also use the System Management Interface Tool (SMIT) smit lsgroup fast path to run this command.

플래그

플래그 설명
-a List 보여 줄 속성. chgroup에 정의된 속성을 공백으로 나눠 줍니다. 빈 목록이면 그룹 이름만 보여 줍니다.
-c 그룹마다 콜론으로 나눈 레코드로 보여 줍니다. 형식: #name: attribute1: attribute2: ... 다음 줄에 Group: value1: value2: ...
-C -c보다 파싱하기 쉬운 콜론 레코드로 보여 줍니다. 첫 줄은 각 필드가 무슨 속성인지 알려 주는 주석이고, -a를 주면 그 순서를 따르며, 값이 없는 속성도 빈 필드로 나오고, 마지막 필드는 줄바꿈으로 끝납니다. 6.1부터
-f 그룹 이름으로 구분한 스탠자 형식으로, Attribute=Value를 한 줄에 하나씩 보여 줍니다.
-R load_module 그룹 속성을 가져올 로드 가능한 I&A 모듈. (6.1) domainlessgroups가 정해져 있고 -R LDAP을 주면, 그룹이 LOCAL에만 있고 LDAP에 없을 때 LOCAL 모듈에서 가져옵니다. -R files도 같습니다.
영어 원문
  • -a List — Specifies the attributes to display. The List parameter can include any attribute that is defined in the chgroup command, and requires a blank space between attributes. If you specify an empty list, only the group names are listed.
  • -c — Displays the attributes for each group in colon-separated records, as follows: #name: attribute1: attribute2: ... Group: value1: value2: ...
  • -C — Displays the group attributes in colon-separated records that are easier to parse than the output of the -c flag: #name:attribute1:attribute2: ... Group1:value1:value2: ... Group2:value1:value2: ... The output is preceded by a comment line that has details about the attribute represented in each colon-separated field. If you also specify the -a flag, the order of the attributes matches the order specified in the -a flag. If you do not have a value for a given attribute, the field is still displayed, but is empty. The last field in each entry ends with a newline character rather than a colon.
  • -f — Displays the group attributes in stanzas. Each stanza is identified by a group name. Each Attribute=Value pair is listed on a separate line: group: attribute1=value attribute2=value attribute3=value
  • -R load_module — Specifies the loadable I&A module that is used to get the group attribute list. If the domainlessgroups attribute is set in the/etc/secvars.cfg file and the -R LDAP command is used, then the attribute list is obtained from the LOCAL module, if the group exists on the LOCAL module, and does not exist on the LDAP module. This condition also applies to the -R files command.

종료 상태

값 뜻
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) 권한이 있는 일반 사용자 프로그램이어야 합니다. 속성은 실행한 사용자의 접근 권한으로 읽으므로, 시스템 접근 정책에 따라 모든 정보를 볼 수 없는 사용자도 있습니다. 이 명령에는 신뢰 컴퓨팅 기반(TCB) 속성이 있어야 합니다.

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

읽는 파일: /etc/group, /etc/security/group, /etc/passwd.

영어 원문

Access Control: This command must be a general user program with execute (x) access for all users. Attributes are read with the access rights of the invoker, so all users might not be able to access all the information. This attribute depends on the access policy of your system. This command must have the trusted computing base attribute.

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.

Files Accessed:

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

Limitations

모든 로드 가능한 I&A 모듈이 그룹 나열을 지원하지는 않습니다. 지원하지 않으면 오류를 돌려줍니다.

영어 원문

Listing a group might not be supported by all loadable I&A modules. If the loadable I&A module does not support listing a group, then an error is returned.

예제

명령 하는 일
lsgroup finance finance 그룹의 속성을 기본 형식으로
lsgroup -f -a id users adms finance finance 그룹의 ID, 구성원(users), 관리자(adms)를 스탠자 형식으로
lsgroup -c ALL 모든 그룹의 속성을 콜론 형식으로
lsgroup -R LDAP monsters LDAP I&A 모듈 그룹 monsters의 속성

자주 쓰는 형태:

bash
lsgroup -a id users staff          # 구성원 확인
lsgroup -a id ALL | sort -t= -k2 -n   # GID 순으로
lsgroup -C -a id users ALL         # (6.1) 스크립트용
영어 원문
  1. To display the attributes of the finance group in the default format, enter the following command: lsgroup finance

  2. To display the id, members (users), and administrators (adms) of the finance group in stanza format, enter the following command:

lsgroup -f -a id users adms finance

  1. To display the attributes of all the groups in colon-separated format, enter the following command:

lsgroup -c ALL

All the attribute information is displayed, with each attribute separated by a blank space.

  1. To display the attributes of the LDAP I&A loadable module group monsters, enter the following command: lsgroup -R LDAP monsters

파일

파일 설명
/usr/sbin/lsgroup lsgroup 명령
/etc/group 그룹의 기본 속성
/etc/security/group 그룹의 확장 속성
/etc/passwd 사용자 ID, 이름, 홈 디렉터리, 로그인 셸, finger 정보
영어 원문
  • /usr/sbin/lsgroup — Contains the lsgroup command.
  • /etc/group — Contains the basic attributes of groups.
  • /etc/security/group — Contains the extended attributes of groups.
  • /etc/passwd — Contains user IDs, user names, home directories, login shell, and finger information.

Related reference:

  • mkgroup Command
  • mkuser Command

Related information:

  • chgroup command
  • chgrpmem command
  • rmuser command

리눅스(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에 둡니다. 그룹 정보는 getent group 그룹, 사용자의 그룹은 id -Gn 이름으로 봅니다.