pwdadm 명령어 (AIX 5.3·6.1)

핵심 정리

  • 관리자(root, security 그룹, PasswdManage 권한)가 사용자의 비밀번호를 정하거나 바꾸고 비밀번호 플래그를 다룹니다.
  • pwdadm 사용자: 비밀번호를 정합니다. 실행한 사람의 비밀번호를 먼저 묻고, ADMCHG가 붙어 사용자는 다음 로그인 때 바꿔야 합니다.
  • pwdadm -q 사용자: 마지막 변경 시각(lastupdate)과 플래그를 봅니다. -c는 플래그를 모두 지웁니다.
  • pwdadm -f 플래그 사용자: NOCHECK(규칙 면제), ADMIN(root만 바꿀 수 있음), ADMCHG(다음 로그인 때 바꾸게)를 쉼표로 나눠 정합니다.
  • root와 security 그룹 구성원은 자기 비밀번호를 이 명령으로 바꾸지 않습니다(ADMCHG 때문에 다음 로그인 때 또 바꿔야 함).
항목 내용
버전 AIX 5.3, AIX 6.1 (내용이 같고, 6.1 문서에 RBAC 안내가 더해짐)
원문 IBM Commands Reference — 5.3 Volume 4, 6.1 Volume 4
파일 /usr/bin/pwdadm, /etc/security/passwd, /etc/passwd, /etc/security/user
관련 명령어 passwd, chpasswd, chuser, lsuser, su

목적

사용자의 비밀번호를 관리합니다.

영어 원문

Administers users' passwords.

구문

text
pwdadm [ -R load_module ] [ -f Flags | -q | -c ] User

설명

pwdadm 명령은 사용자의 비밀번호를 관리합니다. root나 security 그룹 구성원은 User 매개변수로 지정한 사용자의 비밀번호를 주거나 바꿀 수 있습니다. 다른 사용자의 비밀번호를 바꾸기 전에 실행한 사람의 비밀번호를 물어 확인합니다. 실행하면 ADMCHG 속성을 정하므로, 그 사용자로 다음에 su(또는 로그인)할 때 비밀번호를 바꿔야 합니다.

참고: 여기 설명은 로컬 사용자의 동작입니다. 원격 도메인에 정의된 사용자는 속성을 로컬 파일이 아닌 원격 도메인에서 가져오고 저장합니다.

root와 security 그룹 구성원은 이 명령으로 자기 비밀번호를 바꾸지 않습니다. ADMCHG 때문에 다음 로그인이나 su 때 다시 바꿔야 하기 때문입니다. 관리 사용자(/etc/security/user에 admin=true)의 비밀번호 정보는 root나 PasswdAdmin 권한이 있는 사용자만 바꿀 수 있습니다.

User의 비밀번호를 주거나 바꾸는 일은 root, security 그룹 구성원, PasswdManage 권한이 있는 사용자만 할 수 있습니다.

실행하면 /etc/passwd의 그 사용자 비밀번호 필드를 !로 바꿔, 암호화한 비밀번호가 /etc/security/passwd에 있음을 나타냅니다. root나 security 그룹 구성원이 pwdadm으로 비밀번호를 바꾸면 ADMCHG가 붙습니다.

새 비밀번호는 -f NOCHECK을 주지 않는 한 /etc/security/user의 규칙을 따라야 하며, 7비트 문자만 쓸 수 있습니다. -f로 비밀번호 규칙을 바꾸는 플래그를 정할 수 있습니다. -f를 줬을 때 /etc/security/passwd에 그 사용자의 항목이 없으면 /etc/passwd의 비밀번호 필드는 !로, password= 필드는 비밀번호가 없음을 뜻하는 *로 정합니다.

-q는 비밀번호 정보를 봅니다. lastupdate와 flags 속성만 보이고 암호화한 비밀번호는 감춥니다. -c는 사용자의 비밀번호 플래그를 모두 지웁니다.

영어 원문

The pwdadm command administers users' passwords. The root user or a member of the security group can supply or change the password of the user specified by the User parameter. The invoker of the command must provide a password when queried before being allowed to change the other user's password. When the command executes, it sets the ADMCHG attribute. This forces the user to change the password the next time a su command is given for the user.

Note: The behavior described for this command is for a local user. For users defined in a remote domain, attributes will be retrieved and stored in the remote domain rather than in the local files.

Root users and members of the security group should not change their personal password with this command. The ADMCHG attribute would require them to change their password again the next time a login command or an su command is given for the user. Only the root user or a user with PasswdAdmin authorization can change password information for administrative users, who have the admin attribute set to true in the /etc/security/user file.

Only the root user, a member of the security group, or a user with PasswdManage authorization can supply or change the password of the user specified by the User parameter.

When this command is executed, the password field for the user in the /etc/passwd file is set to ! (exclamation point), indicating that an encrypted version of the password is in the /etc/security/passwd file. The ADMCHG attribute is set when the root user or a member of the security group changes a user's password with the pwdadm command.

A new password must be defined according to the rules in the /etc/security/user file, unless the -f NOCHECK flag is included. Only 7-bit characters are supported in passwords. By including the -f flag with the pwdadm command, the root user or a member of the security group can set attributes that change the password rules. If there is no password entry in the /etc/security/passwd file when the -f flag is used, the password field in the /etc/passwd file is set to ! (exclamation point) and an * (asterisk) appears in the password= field to indicate that no password has been set.

The -q flag permits the root user or members of the security group to query password information. Only the status of the lastupdate attribute and the flags attribute appear. The encrypted password remains hidden.

The -c flag clears all password flags for the user.

플래그

플래그 설명
-c 사용자의 비밀번호 플래그를 모두 지웁니다.
-f Flags 비밀번호의 flags 속성. 쉼표로 나눈 다음 값입니다. NOCHECK: 새 비밀번호가 /etc/security/user의 규칙을 따르지 않아도 됨. ADMIN: root만 비밀번호 정보를 바꿀 수 있음(root만 켜고 끔). ADMCHG: 비밀번호는 바꾸지 않고 ADMCHG만 정해 다음 로그인이나 su 때 바꾸게 함. 사용자가 비밀번호를 바꾸면 지워집니다.
-q 비밀번호 상태(lastupdate, flags)를 봅니다.
-R load_module 사용자 속성을 바꿀 때 쓸 로드 가능한 I&A 모듈.
영어 원문
  • -c — Clears all password flags for the user.
  • -f Flags — Specifies the flags attribute of a password. The Flags variable must be from the following list of comma-separated attributes: NOCHECK Signifies that new passwords need not follow the guidelines established in the /etc/security/user file for password composition. ADMIN Specifies that password information may be changed only by the root user. Only the root user can enable or disable this attribute. ADMCHG Resets the ADMCHG attribute without changing the user's password. This forces the user to change passwords the next time a login command or an su command is given for the user. The attribute is cleared when the user specified by the User parameter resets the password.
  • -q — Queries the status of the password. The values of the lastupdate attribute and the flags attribute appear.
  • -R load_module — Specifies the loadable I&A module that is used to change the user's attributes.

보안

접근 제어: root와 security 그룹 구성원만 이 명령의 실행(x) 권한을 가져야 합니다. 신뢰 컴퓨팅 기반 속성이 있어야 하고, /etc/passwd, /etc/security/passwd 같은 사용자 데이터베이스 파일에 쓰려면 root로 setuid되어 있어야 합니다.

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

감사 이벤트: PASSWORD_Change(사용자), PASSWORD_Flags(사용자, 플래그).

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

영어 원문

Access Control: Only the root user and members of the security group should have execute (x) access to this command. The command should have the trusted computing base attribute and be setuid to the root user to have write (w) access to the /etc/passwd file, the /etc/security/passwd file, and other user database files.

Files Accessed:

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

Auditing Events:

Event Information PASSWORD_Change user PASSWORD_Flags user, flags

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.

예제

  1. security 그룹 구성원이 사용자 susan의 비밀번호를 정합니다. 수잔의 비밀번호를 바꾸기 전에 실행한 사람의 비밀번호를 묻습니다.
bash
pwdadm susan
  1. susan의 비밀번호 상태를 봅니다. NOCHECK과 ADMCHG가 켜져 있으면 다음과 같습니다.
text
$ pwdadm -q susan
susan:
        lastupdate=
        flags=NOCHECK,ADMCHG

자주 쓰는 형태:

bash
pwdadm -q app1                 # lastupdate(초)와 플래그
pwdadm -f ADMCHG app1          # 다음 로그인 때 비밀번호를 바꾸게
pwdadm -f NOCHECK svcuser      # 서비스 계정을 규칙에서 면제
pwdadm -c app1                 # 플래그 모두 지우기
perl -le 'print scalar localtime 1735689600'   # lastupdate 초를 날짜로
영어 원문
  1. To set a password for user susan, a member of the security group enters: pwdadm susan

When prompted, the user who invoked the command is prompted for a password before Susan's password can be changed.

  1. To query the password status for user susan, a member of the security group enters: pwdadm -q susan

This command displays values for the lastupdate attribute and the flags attribute. The following example shows what appears when the NOCHECK and ADMCHG flags attributes are in effect: susan:

lastupdate=
flags= NOCHECK,ADMCHG

파일

파일 설명
/usr/bin/pwdadm pwdadm 명령
/etc/security/passwd 비밀번호 정보
영어 원문
  • /usr/bin/pwdadm — Contains the pwdadm command.
  • /etc/security/passwd — Contains password information.

html

Related reference:

  • passwd Command

Related information:

  • Securing the network
  • su 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에 둡니다. pwdadm -f ADMCHG에 해당하는 것은 passwd -e 사용자나 chage -d 0 사용자, -q는 passwd -S 사용자나 chage -l 사용자입니다.