rmuser 명령어 (AIX 5.3·6.1)
https://archive.horanglab.com/posts/aix-cmd-rmuser
핵심 정리
- 사용자 계정과 그 속성을 지웁니다.
rmuser 이름. 홈 디렉터리와 파일은 지우지 않으므로 필요하면 따로 지웁니다. -p를 주면/etc/security/passwd의 비밀번호·인증 정보도 지웁니다(6.1은 사용자 키 저장소까지). 보통rmuser -p 이름으로 씁니다.-c(6.1)는 사용자가 로그인해 있거나 프로세스가 돌고 있으면 지우지 않습니다.- 관리 사용자(admin=true)는 root나 UserAdmin 권한이 있는 사용자만 지울 수 있습니다. LDAP 사용자는
-R LDAP을 줍니다. - 지우기 전에 그 사용자가 소유한 파일을
find / -user 이름으로 확인해 두면, 같은 UID를 다른 사용자가 받았을 때 생기는 혼란을 막을 수 있습니다.
| 항목 | 내용 |
|---|---|
| 버전 | AIX 5.3, AIX 6.1 (6.1에서 -c(로그인·실행 중 프로세스 검사)와 -p의 키 저장소 삭제가 더해짐) |
| 원문 | IBM Commands Reference — 5.3 Volume 4, 6.1 Volume 4 |
| 파일 | /usr/sbin/rmuser, /etc/passwd, /etc/security/passwd, /etc/security/user |
| 관련 명령어 | mkuser, chuser, lsuser, rmgroup, who, ps -u |
목적
사용자 계정을 지웁니다.
영어 원문
Removes a user account.
구문
rmuser [ -R load_module ] [ -c ] [ -p ] Name
-c는 6.1 구문에만 있습니다.
설명
rmuser 명령은 Name 매개변수로 지정한 사용자 계정을 지웁니다. 사용자 계정의 속성은 지우지만 홈 디렉터리와 파일은 지우지 않습니다. 사용자 이름이 있어야 합니다. (6.1) -c를 주면 지우기 전에 사용자가 로그인해 있거나 프로세스가 돌고 있는지 검사해, 그렇다면 실패합니다. -p를 주면 /etc/security/passwd의 비밀번호와 다른 인증 정보도 지웁니다.
다른 식별·인증(I&A) 메커니즘으로 만든 계정은 -R에 해당 로드 모듈을 줘서 지웁니다. 로드 모듈은 /usr/lib/security/methods.cfg에 정의됩니다.
관리 사용자(/etc/security/user에 admin=true)는 root나 UserAdmin 권한이 있는 사용자만 지울 수 있습니다.
Web-based System Manager의 Users 응용 프로그램이나 SMIT 빠른 경로 smit rmuser로도 실행할 수 있습니다.
영어 원문
The rmuser command removes the user account that is identified by the Name parameter. This command removes a user account's attributes without removing the user's home directory and files. The user name must exist. If you specify the -c flag, the rmuser command checks whether the user is logged in or has running processes before removing the user account. If the user is logged in or has running processes, the rmuser command fails. If you specify the -p flag, the rmuser command also removes passwords and other user authentication information from the /etc/security/passwd file.
For user accounts that are created with an alternate Identification and Authentication (I&A) mechanism, use the -R flag with the appropriate load module to remove that user. The load modules are defined in the /usr/lib/security/methods.cfg file.
Only the root user or users with UserAdmin authorization can remove administrative users. Administrative users are those users with admin=true set in the /etc/security/user file.
You can use the Users application in Web-based System Manager to change user characteristics.
You can also use the System Management Interface Tool (SMIT) smit rmuser fast path to run this command.
플래그
| 플래그 | 설명 |
|---|---|
-c |
지우기 전에 사용자가 로그인해 있지 않고 실행 중인 프로세스가 없는지 확인합니다. 6.1부터 |
-p |
/etc/security/passwd에서 사용자 비밀번호 정보를 지우고, (6.1) 사용자 키 저장소도 지웁니다. |
-R load_module |
사용자 계정을 지울 때 쓸 로드 가능한 I&A 모듈. |
영어 원문
-c— Verifies that the user is not logged in and does not have running processes before removing the user account.-p— Removes user password information from the /etc/security/passwd file and removes the user keystore.-Rload_module— Specifies the loadable I&A module that is used to remove the user account.
Parameter
| 매개변수 | 설명 |
|---|---|
| Name | 사용자 계정. |
영어 원문
|
| | |
- Name — Specifies a user account.
종료 상태
| 값 | 뜻 |
|---|---|
| 0 | 성공했고 요청한 변경을 모두 함 |
| 0보다 큼 | 오류. 출력된 오류 메시지에 실패 내용이 자세히 나옴 |
영어 원문
This command returns the following exit values:
- 0 — The command ran 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/security/passwd, /etc/security/user, /etc/security/user.roles, /etc/security/limits, /etc/security/environ, /etc/security/audit/config, /etc/group, /etc/security/group.
감사 이벤트: USER_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 rw /etc/passwd rw /etc/security/passwd rw /etc/security/user rw /etc/security/user.roles rw /etc/security/limits rw /etc/security/environ rw /etc/security/audit/config rw /etc/group rw /etc/security/group
Auditing Events:
Event Information USER_Remove user
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.
예제
| 명령 | 하는 일 |
|---|---|
rmuser davis |
로컬 시스템에서 davis 계정과 그 속성을 지움 |
rmuser -p davis |
davis 계정과 속성, /etc/security/passwd의 비밀번호·인증 정보까지 지움 |
rmuser -R LDAP davis |
LDAP 로드 모듈로 만든 davis 계정을 지움 |
자주 쓰는 형태:
who | grep app1; ps -fu app1 # 로그인·프로세스 확인
rmuser -c -p app1 # (6.1) 로그인 중이면 지우지 않음
find / -xdev -user app1 -ls 2>/dev/null # 남은 파일(지우기 전에 확인 권장)
rm -r /home/app1 # 홈 디렉터리는 따로 지움
영어 원문
To remove the user account
davisand its attributes from the local system, enter:rmuser davisTo remove the user account
davisand all its attributes, including passwords and other user authentication information in the /etc/security/passwd file, type:rmuser -p davisTo remove the user account
davis, who was created with the LDAP load module, type:rmuser -R LDAP davis
파일
| 파일 | 설명 |
|---|---|
/usr/sbin/rmuser |
rmuser 명령 |
/etc/passwd |
사용자 계정의 기본 속성 |
/etc/security/passwd |
비밀번호 정보 |
/etc/security/limits |
사용자 계정별 자원 한도 |
/etc/security/user |
사용자 계정의 확장 속성 |
/etc/security/user.roles |
사용자 계정의 관리 역할 속성 |
/etc/security/environ |
사용자 계정의 환경 속성 |
/etc/security/audit/config |
감사 구성 정보 |
/etc/group |
그룹의 기본 속성 |
/etc/security/group |
그룹의 확장 속성 |
영어 원문
- /usr/sbin/rmuser — Contains the rmuser command.
- /etc/passwd — Contains the basic attributes of user accounts.
- /etc/security/passwd — Contains password information.
- /etc/security/limits — Defines resource quotas and limits for each user account.
- /etc/security/user — Contains the extended attributes of user accounts.
- /etc/security/user.roles — Contains the administrative role attributes of user accounts.
- /etc/security/environ — Contains environment attributes of user accounts.
- /etc/security/audit/config — Contains audit configuration information.
- /etc/group — Contains the basic attributes of groups.
- /etc/security/group — Contains the extended attributes of groups.
Related information:
- chfn command
- chsh command
- lsgroup command
- Securing the network
- Users, roles, and passwords
리눅스(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에 둡니다. rmuser -p에 해당하는 것은 userdel 이름이며, userdel -r은 홈 디렉터리와 메일 스풀까지 지웁니다.