chuser 명령어 (AIX 5.3·6.1)
https://archive.horanglab.com/posts/aix-cmd-chuser
핵심 정리
- 사용자 속성을 바꿉니다.
chuser 속성=값 ... 이름. 속성 하나라도 틀리면 아무것도 바꾸지 않습니다. - 자주 쓰는 속성:
account_locked=false(잠금 풀기),login·rlogin(로그인·원격 로그인 허용),groups·pgrp(그룹),home·shell,expires(계정 만료),maxage·minlen·histsize등(비밀번호 규칙),fsize·data·nofiles등(자원 한도,-1은 무제한). - 로그인 실패로 잠긴 계정은
chsec -f /etc/security/lastlog -s 이름 -a unsuccessful_login_count=0으로 실패 횟수를 0으로 되돌리고, 필요하면chuser account_locked=false 이름도 합니다. - 관리 사용자(admin=true)의 속성은 root나 UserAdmin 권한이 있어야 바꿉니다. LDAP 사용자는
-R LDAP을 줍니다. NIS 데이터베이스가 설치된 시스템에서는 쓰지 않습니다. - 사용자 ID(
id)는 보안상 바꾸지 않는 것이 좋습니다. 바꾸면 기존 파일 소유권이 맞지 않게 됩니다.
| 항목 | 내용 |
|---|---|
| 버전 | AIX 5.3, AIX 6.1 (6.1에서 비밀번호 규칙 mindigit·minloweralpha·minupperalpha·minspecialchar, domains, maxulogs, nproc, EFS 키 저장소 속성, Trusted AIX 레이블 속성, domainlessgroups가 더해짐) |
| 원문 | IBM Commands Reference — 5.3 Volume 1, 6.1 Volume 1 |
| 파일 | /usr/bin/chuser, /etc/security/user, /etc/security/limits, /etc/security/lastlog |
| 관련 명령어 | mkuser, lsuser, rmuser, chsec, pwdadm, chsh, chgroup |
목적
사용자 속성을 바꿉니다.
영어 원문
Changes user attributes.
구문
chuser [ -R load_module ] Attribute=Value ... Name
설명
주의: 시스템에 NIS(Network Information Service) 데이터베이스가 설치되어 있으면 chuser를 쓰지 않습니다.
chuser 명령은 Name 매개변수로 지정한 사용자의 속성을 바꿉니다. 사용자 이름이 이미 있어야 합니다. 속성을 바꾸려면 Attribute=Value로 속성 이름과 새 값을 줍니다. 이 명령이 정하는 로컬 사용자 속성은 다음 파일에 있습니다.
/etc/passwd, /etc/security/environ, /etc/security/limits, /etc/security/user, /etc/security/user.roles, /etc/security/audit/config, /etc/group, /etc/security/group
다른 식별·인증(I&A) 메커니즘의 사용자 속성을 바꾸려면 -R로 그 사용자가 정의된 I&A 로드 모듈을 지정합니다. -R이 없으면 로컬 사용자로 봅니다. 로드 모듈은 /usr/lib/security/methods.cfg에 정의됩니다.
속성이나 값을 하나라도 잘못 주면 어떤 속성도 바꾸지 않습니다.
SMIT 빠른 경로 smit chuser로도 사용자 특성을 바꿀 수 있습니다.
계정의 ID를 바꾸면 시스템 보안을 해칠 수 있으므로 바꾸지 않는 것이 좋습니다. 그래도 chuser로 ID를 바꿀 때는 /etc/security/login.cfg의 usw 스탠자에 있는 dist_uniqid 속성이 ID 충돌 검사를 제어하며, 동작은 mkuser와 같습니다.
사용자 변경 제한
사용자 정보를 지키려고 몇 가지 제한이 있습니다. 다음은 root나 UserAdmin 권한이 있는 사용자만 할 수 있습니다.
admin속성을true로 해서 사용자를 관리 사용자로 만들기- 관리 사용자의 속성 바꾸기
- 사용자를 관리 그룹에 더하기
관리 그룹은 admin 속성이 true인 그룹입니다. security 그룹 구성원은 관리 사용자가 아닌 사용자의 속성을 바꾸고 관리 그룹이 아닌 그룹에 사용자를 더할 수 있습니다.
chuser는 로컬 사용자 데이터만 다룹니다. NIS나 DCE 같은 레지스트리 서버의 데이터는 바꿀 수 없습니다.
영어 원문
Attention: Do not use the chuser command if you have a Network Information Service (NIS) database installed on your system.
The chuser command changes attributes for the user identified by the Name parameter. The user name must already exist. To change an attribute, specify the attribute name and the new value with the Attribute=Value parameter. The following files contain local user attributes that are set by this command:
/etc/passwd
/etc/security/environ
/etc/security/limits
/etc/security/user
/etc/security/user.roles
/etc/security/audit/config
/etc/group
/etc/security/group
To change attributes for a user with an alternate Identification and Authentication (I&A) mechanism, the -R flag can be used to specify the I&A load module that user is defined under. If the -R flag is not specified, the chuser command treats the user as a local user. Load modules are defined in the /usr/lib/security/methods.cfg file.
If you specify a single incorrect attribute or attribute value with the chuser command, the command does not change any attribute.
You can use the System Management Interface Tool (SMIT) smit chuser fast path to change user characteristics.
Changing the ID for an account can compromise system security and as a result one should not do so. However, when the ID is changed using the chuser command, ID collision checking is also controlled by the dist_uniqid attribute in the usw stanza of the /etc/security/login.cfg file. The behavior of ID collision control is the same as that described for the mkuser command.
Restrictions on Changing Users
To ensure the integrity of user information, some restrictions apply when using the chuser command. Only the root user or users with UserAdmin authorization can use the chuser command to perform the following tasks:
Make a user an administrative user by setting the admin attribute to true.
Change any attributes of an administrative user.
Add a user to an administrative group.
An administrative group is a group with the admin attribute set to true. Members of the security group can change the attributes of non-administrative users and add users to non-administrative groups.
The chuser command manipulates local user data only. You cannot use it to change data in registry servers like NIS and DCE.
플래그
| 플래그 | 설명 |
|---|---|
-R load_module |
사용자 속성을 바꿀 때 쓸 로드 가능한 I&A 모듈. |
영어 원문
-Rload_module— Specifies the loadable I&A module used to change the user's attributes.
Attributes
적절한 권한이 있으면 다음 속성을 정할 수 있습니다. mindigit, minloweralpha, minspecialchar, minupperalpha는 AIX 6.1 이후에만 지원합니다.
계정과 로그인
| 속성 | 설명 |
|---|---|
account_locked |
계정이 잠겼는지. true(yes, always와 같음)면 접근 거부, false(no, never와 같음, 기본)면 허락. |
admin |
관리 사용자인지. true면 관리 사용자로 root만 속성을 바꿀 수 있음. 기본 false. |
login |
login 명령으로 로그인할 수 있는지. 기본 true. |
rlogin |
telnet·rlogin으로 원격에서 이 계정에 접근할 수 있는지. 기본 true. |
rcmds |
r 명령(rsh, rexec, rcp)의 원격 실행. allow(기본), deny, hostlogincontrol(hostsallowedlogin·hostsdeniedlogin에 따라 정함, LDAP처럼 중앙 사용자에 씀). 원격 셸을 여는 것은 제어하지 않으며, 그것은 rlogin, hostsallowedlogin, hostsdeniedlogin이 제어합니다. 예전의 ttys=!rsh는 rcmds=deny와 같지만 rcmds를 씁니다. |
hostsallowedlogin, hostsdeniedlogin |
(6.1) 로그인을 허락할·거부할 호스트. |
su |
다른 사용자가 su로 이 계정으로 바꿀 수 있는지. 기본 true. |
sugroups |
su로 이 계정으로 바꿀 수 있는 그룹(쉼표로 나눔, ALL은 모두, !그룹은 제외). 없으면 모든 그룹. |
daemon |
cron이나 SRC 데몬으로 프로그램을 실행할 수 있는지. 기본 true. |
ttys |
이 계정에 접근할 수 있는 단말(전체 경로를 쉼표로 나눔, ALL은 모두, !는 제외). 없으면 모든 단말. |
logintimes |
접근을 허락하는 요일·시간. [!]:<time>-<time>, [!]<day>[-<day>][:<time>-<time>], [!]<month>[<daynum>][-<month>[<daynum>]][:<time>-<time>] 형식을 쉼표로 나눠 줍니다. 요일은 mon, tues, THU, Friday처럼 요일·월 이름과 겹치지 않게 줄여 씁니다. |
loginretries |
마지막 성공 뒤 계정을 잠그기 전에 허락하는 로그인 실패 수. 0이나 음수는 제한 없음. 잠기면 관리자가 /etc/security/lastlog의 unsuccessful_login_count를 이 값보다 작게 되돌려야 합니다(chsec -f /etc/security/lastlog -s 이름 -a unsuccessful_login_count=0). |
maxulogs |
(6.1) 사용자당 동시 로그인 최대 수. 넘으면 로그인을 거부. |
expires |
계정 만료 날짜. MMDDhhmmyy(월, 일, 시, 분, 연도 끝 두 자리, 1939~2038년). 0이면 만료 없음(기본). |
tpath |
신뢰 경로 상태. always(신뢰 프로세스만 실행), notsh(신뢰 셸을 부를 수 없고 SAK를 누르면 세션이 끝남), nosak(SAK를 끔, 바이너리 데이터에 SAK 시퀀스가 있을 수 있을 때, 기본), on(SAK로 신뢰 셸을 부를 수 있음). |
신원과 환경
| 속성 | 설명 |
|---|---|
id |
사용자 ID(고유 정수). 바꾸면 보안을 해치므로 바꾸지 않는 것이 좋습니다. |
pgrp |
주 그룹. 올바른 그룹 이름이어야 하고 비울 수 없습니다. |
groups |
사용자가 속한 그룹(쉼표로 나눔). |
admgroups |
사용자가 관리하는 그룹(쉼표로 나눔). |
domains |
(6.1) 사용자가 속한 도메인 목록. |
home |
홈 디렉터리(전체 경로). |
shell |
세션을 시작할 때 실행할 프로그램(전체 경로). |
gecos |
사용자에 대한 일반 정보. 콜론과 줄바꿈은 쓸 수 없습니다. |
umask |
파일을 만들 때 권한을 정하는 값. 기본 022. |
usrenv |
사용자 상태(보호되지 않는) 환경. /etc/security/environ의 형식으로 쉼표로 나눈 Attribute=Value 쌍. |
sysenv |
시스템 상태(보호되는) 환경. 형식은 usrenv와 같습니다. |
roles |
관리 역할(쉼표로 나눔). |
default_roles |
(6.1) 기본 역할. roles에 있는 역할만 쓸 수 있고, ALL은 할당된 모든 역할. |
auditclasses |
감사 클래스(쉼표로 나눔, ALL은 모두). |
capabilities |
login이나 su가 사용자에게 주는 시스템 특권. CAP_AACCT(고급 회계), CAP_ARM_APPLICATION(ARM 서비스), CAP_BYPASS_RAC_VMM(VMM 자원 제한 우회), CAP_EWLM_AGENT(EWLM 서비스, 보통 EWLM Managed Server의 사용자에게만), CAP_NUMA_ATTACH(특정 자원에 묶기), CAP_PROPAGATE(자식 프로세스가 모든 특권을 물려받음). |
projects |
사용자 프로세스를 할당할 수 있는 프로젝트(쉼표로 나눔, 왼쪽부터). 올바르지 않은 이름은 오류. |
인증과 비밀번호 규칙
| 속성 | 설명 |
|---|---|
auth1 |
주 인증 방법. 쉼표로 나눈 Method;Name 쌍(방법은 /etc/security/login.cfg에 정의). 기본은 SYSTEM 방법과 로컬 비밀번호. NONE은 주 인증을 하지 않음. |
auth2 |
보조 인증 방법. 형식은 auth1과 같고 기본은 NONE(보조 인증 없음). |
maxage |
비밀번호 최대 사용 기간(주, 0~52). 0이면 제한 없음(기본). |
minage |
비밀번호를 바꿀 수 있게 되기까지의 최소 기간(주, 0~52). 기본 0. |
maxexpired |
maxage가 지난 뒤 사용자가 스스로 비밀번호를 바꿀 수 있는 기간(주, 0~52). 지나면 관리자만 바꿀 수 있음. 기본 -1(제한 없음). 0이면 maxage에 바로 만료. maxage가 0이면 무시. root는 예외. |
pwdwarntime |
비밀번호를 바꿔야 한다고 미리 알리는 날 수. 0이나 음수면 알리지 않음. maxage와 minage의 차이보다 작아야 합니다. |
minlen |
비밀번호 최소 길이. 기본 0, 최대 8. 실제 최소 길이는 minlen과 minalpha + minother 중 큰 값이며, minalpha + minother가 8을 넘으면 minother를 8 - minalpha로 줄여 씁니다. |
minalpha |
새 비밀번호에 들어갈 영문자 최소 수(0~8). |
minother |
새 비밀번호에 들어갈 영문자가 아닌 문자 최소 수(0~8). |
mindiff |
새 비밀번호에 있어야 하는, 예전 비밀번호에 없던 문자 최소 수(0~8). |
maxrepeats |
새 비밀번호에서 한 문자가 반복될 수 있는 최대 횟수(0~8). 0은 의미가 없어 기본 8이 제한 없음. |
minloweralpha, minupperalpha, mindigit, minspecialchar |
(6.1) 새 비밀번호에 들어갈 소문자, 대문자, 숫자, 특수 문자의 최소 수(0~PW_PASSLEN). 기본 0. |
histexpire |
같은 비밀번호를 다시 쓸 수 없는 기간(주). 기본 0. 관리 사용자만 바꿀 수 있음. |
histsize |
다시 쓸 수 없는 예전 비밀번호 수(0~50). 기본 0. 관리 사용자만 바꿀 수 있음. |
dictionlist |
새 비밀번호를 검사할 사전 파일(절대 경로를 쉼표로 나눔, 왼쪽부터). 사전 파일은 root 말고는 쓸 수 없어야 하며, 한 줄에 한 단어(7비트 ASCII)입니다. 텍스트 처리 도구를 설치했다면 /usr/share/dict/words를 권합니다. |
pwdchecks |
새 비밀번호에 적용할 제한 메서드(쉼표로 나눔, 왼쪽부터). 절대 경로나 /usr/lib 기준 상대 경로의 실행 가능 로드 모듈. |
자원 한도(/etc/security/limits)
크기 단위는 512바이트 블록이며, _hard가 붙지 않은 것은 소프트 한도, 붙은 것은 하드 한도입니다. -1은 무제한입니다.
| 속성 | 설명 |
|---|---|
core, core_hard |
프로세스가 만들 수 있는 가장 큰 코어 파일. |
cpu, cpu_hard |
프로세스가 쓸 수 있는 가장 많은 CPU 시간(초). 음수는 무제한(cpu_hard 기본 -1). |
data, data_hard |
가장 큰 데이터 세그먼트. 최솟값 1272. |
fsize, fsize_hard |
만들거나 늘릴 수 있는 가장 큰 파일. 2GB보다 큰 파일을 쓰려면 -1. 최솟값 8192. |
nofiles, nofiles_hard |
동시에 열 수 있는 파일 디스크립터 수. nofiles_hard 기본 -1(시스템 최대). |
nproc, nproc_hard |
(6.1) 동시에 실행할 수 있는 프로세스 수(1 이상). 기본 -1(시스템 최대). |
rss, rss_hard |
할당할 수 있는 가장 많은 물리 메모리. 지금은 시스템이 강제하지 않습니다. |
stack, stack_hard |
가장 큰 스택 세그먼트. 최솟값 49, stack_hard 최댓값 2147483647. |
threads, threads_hard |
프로세스가 만들 수 있는 스레드 수(1 이상). 커널과 pthread 라이브러리가 모두 강제합니다. |
코어 파일
| 속성 | 설명 |
|---|---|
core_compress |
코어 파일 압축. On·Off(기본). |
core_naming |
On이면 코어 파일 이름을 core.pid.time으로(환경 변수 CORE_NAMING과 같음), Off면 core. |
core_path |
On이면 core_pathname의 디렉터리에, Off(기본)면 현재 작업 디렉터리에 코어 파일을 둡니다. |
core_pathname |
core_path가 On일 때 코어 파일을 둘 위치(256자 이내). |
암호화 파일 시스템(EFS, 6.1)
EFS를 켠 시스템에서만 유효합니다.
| 속성 | 설명 |
|---|---|
efs_keystore_access |
사용자 키 저장소의 데이터베이스 유형. file(기본, /var/efs/users/사용자/keystore를 만듦), none(만들지 않으며 다른 키 저장소 속성은 효과 없음). |
efs_adminks_access |
efs_admin 키 저장소의 데이터베이스 유형. file만 됩니다. |
efs_initialks_mode |
사용자 키 저장소의 처음 모드. admin(기본, root 등이 관리 키로 열고 비밀번호를 되돌릴 수 있음), guard(그럴 수 없음). mkuser와 함께 씁니다. |
efs_allowksmodechangebyuser |
사용자가 모드를 바꿀 수 있는지. yes(기본), no. |
efs_keystore_algo |
키 저장소를 만들 때 개인 키 생성 알고리즘. RSA_1024(기본), RSA_2048, RSA_4096. 만든 뒤 바꿔도 키 저장소를 지우고 다시 만들지 않는 한 키는 다시 만들어지지 않습니다. |
efs_file_algo |
사용자 파일의 암호화 알고리즘. AES_128_CBC(기본), AES_128_ECB, AES_192_CBC, AES_192_ECB, AES_256_CBC, AES_256_ECB. |
Trusted AIX 레이블(6.1)
Trusted AIX에서만 유효합니다. 값은 /etc/security/enc/LabelEncodings에 정의되며, 공백이 있으면 따옴표로 감쌉니다.
| 속성 | 설명 |
|---|---|
minsl, maxsl, defsl |
최소·최대 보안 허가 등급과 로그인 때의 기본 보안 레이블. minsl ≤ defsl ≤ maxsl(지배 관계). |
mintl, maxtl, deftl |
최소·최대 무결성 허가 등급과 로그인 때의 기본 무결성 레이블. "Integrity labels" 절이 있으면 그 값을 씁니다. mintl ≤ deftl ≤ maxtl. |
(6.1) /etc/secvars.cfg에 domainlessgroups 속성이 정해져 있으면 groups, admgroups, pgrp, sugroups에 LDAP 그룹을 로컬 사용자에게(또는 반대로) 줄 수 있습니다.
영어 원문
The following attributes of the chuser command are supported only on AIX 6.1, or later:
mindigit
minloweralpha
minspecialchar
minupperalpha
If you have the proper authority, you can set the following user attributes:
account_locked— Indicates if the user account is locked. Possible values include: true The user's account is locked. The values yes, true, and always are equivalent. The user is denied access to the system. false The user's account is not locked. The values no, false, and never are equivalent. The user is allowed access to the system. This is the default value.- admin — Defines the administrative status of the user. Possible values are: true The user is an administrator. Only the root user can change the attributes of users defined as administrators. false The user is not an administrator. This is the default value.
- admgroups — Defines the groups that the user administrates. If the domainlessgroups attribute is set in the /etc/secvars.cfg file, the Lightweight Directory Access Protocol ( LDAP) group can be assigned to the local user and vice versa. For more information, see /etc/secvars.cfg. The Value parameter is a comma-separated list of group names.
- auditclasses — Defines the user's audit classes. The Value parameter is a list of comma-separated classes, or a value of ALL to indicate all audit classes.
- auth1 — Defines the primary methods for authenticating the user. The Value parameter is a comma-separated list of Method;Name pairs. The Method parameter is the name of the authentication method. The Name parameter is the user to authenticate. If you do not specify a Name parameter, the name of the invoking login program is used. Valid authentication methods are defined in the /etc/security/login.cfg file. By default, the SYSTEM method and local password authentication are used. The NONE method indicates that no primary authentication check is made.
- auth2 — Defines the secondary methods used to authenticate the user. The Value parameter is a comma-separated list of Method;Name pairs. The Method parameter is the name of the authentication method. The Name parameter value is the user to authenticate. If this attribute is not specified, the default is NONE, indicating that no secondary authentication check is made. Valid authentication methods are defined in the /etc/security/login.cfg file. If you do not specify a Name parameter, the name of the invoking login program is used.
- capabilities — Defines the system privileges (capabilities) which are granted to a user by the login or su commands. Valid capabilities are:
CAP_AACCTPerformed Advanced Accounting operations.CAP_ARM_APPLICATIONA process has the ability to use the ARM (Application Response Measurement) services.CAP_BYPASS_RAC_VMMA process has the ability to bypass restrictions on VMM resource usage.CAP_EWLM_AGENTA process has the ability to use the EWLM (Enterprise Workload Manager™) AIXsystem services. This capability is typically only granted to the userid that runs the EWLM product's Managed Server Component.CAP_NUMA_ATTACHA process has the ability to bind to specific resources.CAP_PROPAGATEAll capabilities are inherited by child processes. The value is a comma-separated list of zero or more capability names. - core — Specifies the soft limit for the largest core file a user's process can create. The Value parameter is an integer representing the number of 512-byte blocks.
core_compress— Enables or disables core file compression. Valid values for this attribute are On and Off. If this attribute has a value of On, compression is enabled; otherwise, compression is disabled. The default value of this attribute is Off.core_hard— Specifies the largest core file a user's process can create. The Value parameter is an integer representing the number of 512-byte blocks..core_naming— Selects a choice of core file naming strategies. Valid values for this attribute are On and Off. A value of On enables core file naming in the formcore.pid.time, which is the same as what theCORE_NAMINGenvironment variable does. A value of Off uses the default name of core.core_path— Enables or disables core file path specification. Valid values for this attribute are On and Off. If this attribute has a value of On, core files will be placed in the directory specified bycore_pathname(the feature is enabled); otherwise, core files are placed in the user's current working directory. The default value of this attribute is Off.core_pathname— Specifies a location to be used to place core files, if thecore_pathattribute is set to On. If this is not set andcore_pathis set to On, core files will be placed in the user's current working directory. This attribute is limited to 256 characters.- cpu — Identifies the soft limit for the largest amount of system unit time (in seconds) that a user's process can use. The Value parameter is an integer. All negative values are considered as unlimited.
cpu_hard— Identifies the largest amount of system unit time (in seconds) that a user's process can use. The Value parameter is an integer. The default value is -1 which turns off restrictions.- daemon — Indicates whether the user specified by the Name parameter can run programs using the cron daemon or the src (system resource controller) daemon. Possible values are: true The user can initiate cron and src sessions. This is the default. false The user cannot initiate cron and src sessions.
- data — Specifies the soft limit for the largest data segment for a user's process. The Value parameter is an integer representing the number of 512-byte blocks. The minimum allowable value for this attribute is 1272. Specify
-1to make it unlimited. data_hard— Specifies the largest data segment for a user's process. The Value parameter is an integer representing the number of 512-byte blocks. The minimum allowable value for this attribute is 1272. Specify-1to make it unlimited.default_roles— Specifies the default roles for the user. The Value parameter, a comma-separated list of valid role names, can only contain roles assigned to the user in the roles attribute. You can use the ALL keyword to signify that the default roles for the user are all their assigned roles.- dictionlist — Defines the password dictionaries used by the composition restrictions when checking new passwords. The password dictionaries are a list of comma-separated absolute path names, evaluated from left to right. All dictionary files and directories must be write protected from all users except root. The dictionary files are formatted one word per line. The word starts in the first column and terminates with a newline character. Only 7 bit ASCII words are supported for passwords. If you install the text processing tool on your system, the recommended dictionary file is the /usr/share/dict/words file.
- domains — Defines the list of domains that the user belongs to.
- expires — Identifies the expiration date of the account. The Value parameter is a 10-character string in the MMDDhhmmyy form, where MM = month, DD = day, hh = hour, mm = minute, and yy = last 2 digits of the years 1939 through 2038. All characters are numeric. If the Value parameter is 0, the account does not expire. The default is 0. See the date command for more information.
- fsize — Defines the soft limit for the largest file a user's process can create or extend. The Value parameter is an integer representing the number of 512-byte blocks. To make files greater than 2G, specify
-1. The minimum value for this attribute is 8192. fsize_hard— Defines the largest file a user's process can create or extend. The Value parameter is an integer representing the number of 512-byte blocks. To make files greater than 2G, specify-1. The minimum value for this attribute is 8192.- gecos — Supplies general information about the user specified by the Name parameter. The Value parameter is a string with no embedded colon (
:) character and no embedded newline character. - groups — Identifies the groups to which user belongs. If the domainlessgroups attribute is set in the /etc/secvars.cfg file, the LDAP group can be assigned to the local user and vice versa. For more information, see /etc/secvars.cfg. The Value parameter is a comma-separated list of group names.
- histexpire — Defines the period of time (in weeks) that a user cannot reuse a password. The value is a decimal integer string. The default is 0, indicating that no time limit is set. Only an administrative user can change this attribute.
- histsize — Defines the number of previous passwords a user cannot reuse. The value is a decimal integer string. The default is 0. This attribute can have a value in the range 0 - 50. Only an administrative user can change this attribute.
- home — Identifies the home directory of the user specified by the Name parameter. The Value parameter is a full path name.
- id — Specifies the user ID. The Value parameter is a unique integer string. Changing this attribute compromises system security and, for this reason, you should not change this attribute.
- login — Indicates whether the user can log in to the system with the login command. Possible values are: true The user can log in to the system. This is the default. false The user cannot log in to the system.
- loginretries — Defines the number of unsuccessful login attempts allowed after the last successful login before the system locks the account. The value is a decimal integer string. A zero or negative value indicates that no limit exists. Once the user's account is locked, the user will not be able to log in until the system administrator resets the user's
unsuccessful_login_countattribute in the /etc/security/lastlog file to be less than the value of loginretries. To do this, enter the following:chsec -f /etc/security/lastlog -s username -a \ unsuccessful_login_count=0 - logintimes — Defines the days and times that the user is allowed to access the system. The value is a comma-separated list of entries in one of the following formats:
[!]:<time>-<time> [!]<day>[-<day>][:<time>-<time>] [!]<month>[<daynum>][-<month>[<daynum>]][:<time>-<time>]Possible values for<day>include mon, tues, w, THU, Friday, sat, and SUNDAY. Indicate the day value as any abbreviated day of the week; however, the abbreviation must be unique with respect to both day and month names. The range of days can be circular, such as Tuesday-Monday. Day names are case insensitive. Possible values for<time>include times specified in 24-hour military format. Precede the time value with a : (colon) and specify a string of 4 characters. Leading zeros are required. Thus, 0800 (8am) is valid while 800 is not valid. An entry consisting of only a specified time period applies to every day. The start hour must be less than the end hour. The time period cannot flow into the next day. Possible values for<month>include Jan, F, march, apr, and s. Indicate the month value as any abbreviated month; however, the abbreviation must be unique with respect to both day and month names. The range of months can be circular, such as September-June. Month names are case insensitive. Possible values for<daynum>include days 1-31 of a month. This value is checked against the specified month. Specify the month value as either a 1 or 2 character string. A month specified without a daynum value indicates the first or last day of the month, depending on if the month is the start or end month specified, respectively. Entries prefixed with ! (exclamation point) deny access to the system and are called DENY entries. Entries without the ! prefix allow access and are called ACCESS entries. The ! prefix applies to single entries and must prefix each entry. Currently, the system allows 200 entries per user. This attribute is internationalized. Month and day names can be entered and are displayed in the language specified by the locales variables set for the system. The relative order of the month and day values are also internationalized; the<month><daynum>and<daynum><month>formats are accepted. The system evaluates entries in the following order: 1. All DENY entries. If an entry matches the system time, the user is denied access and the ALLOW entries are not processed. 2. All ALLOW entries, if no DENY entries exist. If an ALLOW entry matches the system time, the user is allowed access. If an ALLOW entry does not match the system time, the user is denied access. If no ALLOW entry exists, the user is permitted to log in. - maxage — Defines the maximum age (in weeks) of a password. The password must be changed by this time. The value is a decimal integer string. The default is a value of 0, indicating no maximum age. Range: 0 to 52
- maxexpired — Defines the maximum time (in weeks) beyond the maxage value that a user can change an expired password. After this defined time, only an administrative user can change the password. The value is a decimal integer string. The default is -1, indicating restriction is set. If the maxexpired attribute is 0, the password expires when the maxage value is met. If the maxage attribute is 0, the maxexpired attribute is ignored. Range: 0 to 52 (a root user is exempt from maxexpired)
- maxrepeats — Defines the maximum number of times a character can be repeated in a new password. Since a value of 0 is meaningless, the default value of 8 indicates that there is no maximum number. The value is a decimal integer string. Range: 0 to 8
- maxulogs — Specifies the maximum number of concurrent logins per user. If the concurrent login number for a user exceeds the maximum number of allowed logins, the login is denied.
- minage — Defines the minimum age (in weeks) a password must be before it can be changed. The value is a decimal integer string. The default is a value of 0, indicating no minimum age. Range: 0 to 52
- minalpha — Defines the minimum number of alphabetic characters that must be in a new password. The value is a decimal integer string. The default is a value of 0, indicating no minimum number. Range: 0 to 8
- mindiff — Defines the minimum number of characters required in a new password that were not in the old password. The value is a decimal integer string. The default is a value of 0, indicating no minimum number. Range: 0 to 8
- minlen — Defines the minimum length of a password. The value is a decimal integer string. The default is a value of 0, indicating no minimum length. The maximum value allowed is 8. This attribute is determined by for more information minlen and/or 'minalpha + minother', whichever is greater. 'minalpha + minother' should never be greater than 8. If 'minalpha + minother' is greater than 8, then the effective value for minother is reduced to '8 - minalpha'.
- minother — Defines the minimum number of non-alphabetic characters that must be in a new password. The value is a decimal integer string. The default is a value of 0, indicating no minimum number. Range: 0 to 8
- nofiles — Defines the soft limit for the number of file descriptors a user process may have open at one time. The Value parameter is an integer.
nofiles_hard— Defines the hard limit for the number of file descriptors a user process may have open at one time. The Value parameter is an integer. The default value is -1, which sets the limit to the maximum allowed by the system.- nproc — Defines the soft limit on the number of processes a user can have running at one time. The Value parameter is an integer equal to or greater than 1. The default value is -1, which sets the limit to the maximum allowed by the system.
nproc_hard— Defines the hard limit on the number of processes a user can have running at one time. The Value parameter is an integer equal to or greater than 1. The default value is -1, which sets the limit to the maximum allowed by the system.- pgrp — Identifies the primary group of the user. If the domainlessgroups attribute is set in the /etc/secvars.cfg file, the LDAP group can be assigned as a primary group to the local user and vice versa. For more information, see /etc/secvars.cfg file. The Value parameter must contain a valid group name and cannot be a null value.
- projects — Defines the list of projects to which the user's processes can be assigned. The value is a list of comma-separated project names and is evaluated from left to right. The project name should be a valid project name as defined in the system. If an invalid project name is found on the list, it will be reported as an error.
- pwdchecks — Defines the password restriction methods enforced on new passwords. The value is a list of comma-separated method names and is evaluated from left to right. A method name is either an absolute path name or a path name relative to /usr/lib of an executable load module.
- pwdwarntime — Defines the number of days before the system issues a warning that a password change is required. The value is a decimal integer string. A zero or negative value indicates that no message is issued. The value must be less than the difference of the maxage and minage attributes. Values greater than this difference are ignored and a message is issued when the minage value is reached.
- rcmds — Controls the remote execution of the r-commands (rsh, rexec, and rcp). Possible values are as follows: allow Allows this user to perform remote command execution. This is the default value. deny Denies this user the ability to use remote command execution. hostlogincontrol Specifies that the ability of remote command execution is determined by the hostsallowedlogin and hostsdeniedlogin attributes. The user is only allowed to execute remote commands on a target system if the user (or target user) is allowed to log in the target system. This value is typically used for users defined in a centralized user database, such as LDAP, where the user might be allowed to log in to some systems but not others. hostsallowedlogin Allows the user to login to the specified hosts. hostsdeniedlogin The user is not allowed to login to the specified hosts. Note: The rcmds attribute controls only remote command execution. It does not control r-command functionality to open a remote shell. Login functions such as this are controlled by the rlogin, hostsallowedlogin, and hostsdeniedlogin attributes. Although the deprecated ttys attribute value
!rsh, which is effectively the same as setting the rcmds attribute to deny, is still supported for purposes of backward compatibility, the rcmds attribute should be used instead to control the execution of r-commands. - rlogin — Permits access to the account from a remote location with the telnet orrlogin commands. Possible values are: true The user account can be accessed remotely. This is the default rlogin value. false The user cannot be accessed remotely.
- roles — Defines the administrative roles for this user. The Value parameter is a list of role names, separated by commas.
- rss — The soft limit for the largest amount of physical memory a user's process can allocate. The Value parameter is a decimal integer string specified in units of 512-byte blocks. This value is not currently enforced by the system.
rss_hard— The largest amount of physical memory a user's process can allocate. The Value parameter is a decimal integer string specified in units of 512-byte blocks. This value is not currently enforced by the system.- shell — Defines the program run for the user at session initiation. The Value parameter is a full path name.
- stack — Specifies the soft limit for the largest process stack segment for a user's process. The Value parameter is an integer representing the number of 512-byte blocks to allot. The minimum allowable value for this attribute is 49.
stack_hard— Specifies the largest process stack segment of a user's process. The Value parameter is an integer representing the number of 512-byte blocks to allot. The minimum allowable value for this attribute is 49. The largest allowable value for this parameter is 2147483647.- su — Indicates whether another user can switch to the specified user account with the su command. Possible values are: true Another user can switch to the specified account. This is the default. false Another user cannot switch to the specified account.
- sugroups — Defines the groups that can use the su command to switch to the specified user account. The Value parameter is a comma-separated list of group names, or a value of ALL that indicates all groups. An exclamation point (!) in front of a group name excludes that group. If this attribute is not specified, all groups can switch to this user account by using the su command. If the domainlessgroups attribute is set in the /etc/secvars.cfg file, the LDAP group can be assigned to the local user and vice versa. For more information, see /etc/secvars.cfg file. Note: If a user belongs to multiple groups and any of the groups specified with the exclamation point (!), then user cannot use the su command to access the specified user account.
- sysenv — Identifies the system-state (protected) environment. The Value parameter is a set of comma-separated Attribute=Value pairs as specified in the /etc/security/environ file.
- threads — Specifies the soft limit for the largest number of threads that a user process can create. The Value parameter is an integer equal to or greater than 1, representing the number of threads each user process can create. This limit is enforced by both the kernel and the user space pthread library.
threads_hard— Specifies the largest possible number of threads that a user process can create. The Value parameter is an integer equal to or greater than 1, representing the number of threads each user process can create. This limit is enforced by both the kernel and the user space pthread library.- tpath — Indicates the user's trusted path status. The possible values are: always The user can only execute trusted processes. This implies that the user's initial program is in the trusted shell or some other trusted process. no tsh The user cannot invoke the trusted shell on a trusted path. If the user enters the secure attention key (SAK) after logging in, the login session ends. nosak The secure attention key (SAK) is disabled for all processes run by the user. Use this value if the user transfers binary data that may contain the SAK sequence. This is the default value. on The user has normal trusted path characteristics and can invoke a trusted path (enter a trusted shell) with the secure attention key (SAK).
- ttys — Defines the terminals that can access the account specified by the Name parameter. The Value parameter is a comma-separated list of full path names, or a value of ALL to indicate all terminals. An ! (exclamation point) in front of a terminal name excludes that terminal. If this attribute is not specified, all terminals can access the user account.
- umask — Determines file permissions. This value, along with the permissions of the creating process, determines a file's permissions when the file is created. The default is 022.
- usrenv — Defines the user-state (unprotected) environment. The Value parameter is a set of comma-separated Attribute=Value pairs as specified in the /etc/security/environ file.
efs_keystore_access— Specifies the database type of the user keystore. You can specify the following values: file Creates the /var/efs/users/usrname/keystore keystore file associated with the user. none Keystore is not created. All the other keystore attributes have no effect. The default value is file. Restriction: The attribute is valid only when the system is EFS-enabled.efs_adminks_access— Represents the database type for theefs_adminkeystore. The only valid value is file. Restriction: The attribute is valid only when the system is EFS-enabled.efs_initialks_mode— Specifies the initial mode of the user keystore. You can specify the following values: admin Root or other security privileged system users can open the keystore using the admin key and reset the keystore password. guard Root users cannot open the keystore using the admin key or reset the keystore password. The default value is admin. The attribute specifies the initial mode of the user keystore. You can use the attribute with the mkuser command. After the keystore has been created, changing the attribute value with the chuser, chgroup, or chsec command, or manual editing does not change the mode of the keystore unless the keystore is deleted and a new one is created. To change the keystore mode, use the efskeymgr command. Restriction: The attribute is valid only when the system is EFS-enabled.efs_allowksmodechangebyuser— Specifies whether the mode can be changed. You can specify the following values: • yes • no The default value is yes. Restriction: The attribute is valid only when the system is EFS-enabled.efs_keystore_algo— Specifies the algorithm that is used to generate the private key of the user during the keystore creation. You can specify the following values: •RSA_1024•RSA_2048•RSA_4096The default value isRSA_1024. You can use the attribute with the mkuser command. After the keystore has been created, changing the value of this attribute with the chuser, chgroup, or chsec command, or manual editing does not regenerate the private key unless the keystore is deleted and a new one is created. To change the algorithm for the keys, use the efskeymgr command. Restriction: The attribute is valid only when the system is EFS-enabled.efs_file_algo— Specifies the encryption algorithm for user files. You can specify the following values: •AES_128_CBC•AES_128_ECB•AES_192_CBC•AES_192_ECB•AES_256_CBC•AES_256_ECBThe default value isAES_128_CBC. Restriction: The attribute is valid only when the system is EFS-enabled.- minsl — Defines the minimum sensitivity-clearance level that the user can have. Note: This attribute is valid only for Trusted AIX.The valid values are defined in the "Clearances" section of the /etc/security/enc/LabelEncodings file for the system. The value must be defined in quotation marks if it has white spaces. The minsl value must be dominated by the defsl value for the user.
- maxsl — Defines the maximum sensitivity-clearance level that the user can have. Note: This attribute is valid only for Trusted AIX.The valid values are defined in the "Clearances" section of the /etc/security/enc/LabelEncodings file. The value must be defined in quotation marks if it has white spaces. The maxsl value must dominate the defsl value for the user.
- defsl — Defines the default sensitivity level that the user is assigned during login. Note: This attribute is valid only for Trusted AIX.The valid values are defined in the "Clearances" section of the /etc/security/enc/LabelEncodings file. The value must be defined in quotation marks if it has white spaces. The defsl value must dominate the minsl value and be dominated by the maxsl value.
- mintl — Defines the minimum integrity clearance level that the user can have. Note: This attribute is valid only for Trusted AIX.The valid values are defined in the "Sensitivity labels" section of the /etc/security/enc/LabelEncodings file . If the optional "Integrity labels" section is defined in the /etc/security/enc/LabelEncodings file, the value must be from this section. The value must be defined in quotation marks if it contains white spaces. The mintl value must be dominated by the deftl value for the user.
- maxtl — Defines the maximum integrity clearance level that the user can have. Note: This attribute is valid only for Trusted AIX.The valid values are defined in the "Sensitivity labels" section of the /etc/security/enc/LabelEncodings file . If the optional "Integrity labels" section is defined in the /etc/security/enc/LabelEncodings file, the value must be from this section. The value must be defined in quotation marks if it contains white spaces. The maxtl value must dominate the deftl value for the user.
- deftl — Defines the default integrity clearance level that the user is assigned during login. Note: This attribute is valid only for Trusted AIX.The valid values are defined in the "Sensitivity labels" section of the /etc/security/enc/LabelEncodings file . If the optional "Integrity labels" section is defined in the /etc/security/enc/LabelEncodings file, the value must be from this section. The value must be defined in quotation marks if it contains white spaces. The deftl value must dominate the mintl value and be dominated by the maxtl value.
- minloweralpha — Defines the minimum number of lower case alphabetic characters that must be in a new password. The value is a decimal integer string. The default is a value of 0, indicating no minimum number. Range: 0 to
PW_PASSLEN. - minupperalpha — Defines the minimum number of upper case alphabetic characters that must be in a new password. The value is a decimal integer string. The default is a value of 0,indicating no minimum number. Range: 0 to
PW_PASSLEN. - mindigit — Defines the minimum number of digits that must be in a new password. The value is a decimal integer string. The default is a value of 0, indicating no minimum number. Range: 0 to
PW_PASSLEN. - minspecialchar — Defines the minimum number of special characters that must be in a new password. The value is a decimal integer string. The default is a value of 0, indicating no minimum number. Range: 0 to
PW_PASSLEN.
보안
접근 제어: 이 명령의 실행(x) 권한은 root와 security 그룹에만 줘야 합니다. 신뢰 컴퓨팅 기반(TCB) 프로그램으로 설치하고, root가 소유하며 setuid(SUID) 비트를 켜 둬야 합니다.
Trusted AIX 시스템에서는 aix.mls.clear.write 권한이 있는 사용자만 minsl, maxsl, defsl, mintl, maxtl, deftl을 바꿀 수 있습니다.
감사 이벤트: USER_Change(사용자, 속성).
읽고 쓰는 파일: /etc/passwd, /etc/security/user, /etc/security/user.roles, /etc/security/limits, /etc/security/environ, /etc/security/audit/config, /etc/group, /etc/security/group(읽기·쓰기), /etc/security/enc/LabelEncodings, /etc/security/domains(읽기).
RBAC 사용자와 Trusted AIX 사용자는 주의하세요. 이 명령은 특권 작업을 할 수 있으며, 특권 작업은 특권 사용자만 할 수 있습니다. 특권과 권한 목록은 lssecattr 명령이나 getcmdattr 하위 명령으로 봅니다(6.1 문서에만 있음). 명령의 기능을 모두 쓰려면 역할에 accessauths 말고도 aix.security.user.audit, aix.security.role.assign, aix.security.group.change 권한이 있어야 합니다.
영어 원문
Access Control
This command must grant execute (x) access only to the root user and the security group. This command must be installed as a program in the trusted computing base (TCB). The command must be owned by the root user with the setuid (SUID) bit set.
On a Trusted AIX system, only users with the aix.mls.clear.write authorization can modify the attributes minsl, maxsl, defsl, mintl, maxtl and deftl.
Auditing Events
Event Information USER_Change user, attributes
Files Accessed
Mode File rw /etc/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 r /etc/security/enc/LabelEncodings r /etc/security/domains
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 should also have the following authorizations:
aix.security.user.audit
aix.security.role.assign
aix.security.group.change
Limitations
모든 로드 가능한 I&A 모듈이 사용자 속성 변경을 지원하지는 않습니다. 지원하지 않으면 오류를 보고합니다.
영어 원문
Changing a user's attributes may not be supported by all loadable I&A modules. If the loadable I&A module does not support changing a user's attributes, an error is reported.
예제
| 명령 | 하는 일 |
|---|---|
chuser rlogin=true smith |
사용자 smith가 원격에서 접근할 수 있게 함 |
chuser expires=0501080095 davis |
davis 계정의 만료를 1995년 5월 1일 오전 8시로 |
chuser groups=finance,accounting davis |
davis의 그룹을 finance, accounting으로 |
chuser -R LDAP rlogin=false davis |
LDAP 로드 모듈로 만든 davis의 원격 접근을 막음 |
chuser domains=INTRANET,APPLICATION davis |
(6.1) davis의 도메인을 바꿈 |
chuser roles=" " davis |
davis의 역할을 지움 |
자주 쓰는 형태:
chsec -f /etc/security/lastlog -s app1 -a unsuccessful_login_count=0 # 로그인 실패 횟수 되돌리기
chuser account_locked=false app1 # 잠금 풀기
chuser groups=staff,app,dba app1 # groups는 덧붙이기가 아니라 바꾸기(빠뜨린 그룹은 빠짐)
chuser maxage=13 minlen=8 histsize=5 loginretries=5 app1 # 비밀번호·로그인 규칙
chuser fsize=-1 data=-1 nofiles=65536 app1 # 자원 한도(다시 로그인해야 적용)
chuser login=false rlogin=false batchuser # 로그인 못 하는 배치 계정
영어 원문
- To enable user
smithto access this system remotely, type:
chuser rlogin=true smith
- To change the expiration date for the
davisuser account to 8 a.m., 1 May, 1995, type:
chuser expires=0501080095 davis
- To add
davisto the groupsfinanceandaccounting, type:
chuser groups=finance,accounting davis
- To change the user
davis, who was created with the LDAP load module, to not be allowed remote access, type:
chuser -R LDAP rlogin=false davis
- To change the domains of the user
davis, type:
chuser domains=INTRANET,APPLICATION davis
- To unset the roles of the user
davis, type:
chuser roles=" " davis
파일
| 파일 | 설명 |
|---|---|
/usr/bin/chuser |
chuser 명령 |
/etc/passwd |
사용자의 기본 속성 |
/etc/group |
그룹의 기본 속성 |
/etc/security/group |
그룹의 확장 속성 |
/etc/security/user |
사용자의 확장 속성 |
/etc/security/user.roles |
사용자의 관리 역할 속성 |
/etc/security/lastlog |
사용자의 마지막 로그인 속성 |
/etc/security/limits |
사용자별 자원 한도 |
/etc/security/audit/config |
감사 구성 정보 |
/etc/security/environ |
사용자의 환경 속성 |
/etc/security/enc/LabelEncodings |
Trusted AIX의 레이블 정의 |
/etc/security/domains |
시스템의 올바른 도메인 정의 |
영어 원문
- /usr/bin/chuser — Contains the chuser command.
- /etc/passwd — Contains the basic attributes of users.
- /etc/group — Contains the basic attributes of groups.
- /etc/security/group — Contains the extended attributes of groups.
- /etc/security/user — Contains the extended attributes of users.
- /etc/security/user.roles — Contains the administrative role attributes of users.
- /etc/security/lastlog — Contains the last login attributes of users.
- /etc/security/limits — Defines resource quotas and limits for each user.
- /etc/security/audit/config — Contains audit configuration information.
- /etc/security/environ — Contains the environment attributes of users.
- /etc/security/enc/LabelEncodings — Contains the label definitions for the Trusted AIX system.
- /etc/security/domains — Contains the valid domain definitions for the system.
Related reference:
- chsh Command
Related information:
- secvars.cfg File
- Trusted AIX® in the AIX Version 7.1 Security
리눅스(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에 둡니다. chuser에 해당하는 것은 usermod(-G 그룹, -g 주 그룹, -d 홈, -s 셸, -L·-U 잠금·해제, -e 만료)와 chage(비밀번호 기간)입니다. 리눅스 usermod -G도 기존 보조 그룹을 바꾸므로 덧붙이려면 -aG를 씁니다.