lssec 명령어 (AIX 5.3·6.1)
https://archive.horanglab.com/posts/aix-cmd-lssec
핵심 정리
/etc/security아래 스탠자 형식 보안 파일에서 속성을 읽어 보여 줍니다. 형식:lssec -f 파일 -s 스탠자 -a 속성 ....- 자주 쓰는 형태:
lssec -f /etc/security/lastlog -s 사용자 -a unsuccessful_login_count(로그인 실패 수),lssec -f /etc/security/user -s default -a maxage minlen(기본 비밀번호 규칙),lssec -f /etc/security/login.cfg -s usw -a pwd_algorithm. -c는 콜론 형식으로 보여 줘 스크립트에서 쓰기 좋습니다./etc/security/passwd의password속성(해시)은 볼 수 없습니다. 실행 권한은 root와 security 그룹에만 있습니다.- 바꾸는 것은
chsec입니다. 파일을 편집기로 직접 고치는 것보다lssec·chsec을 쓰는 것이 안전합니다.
| 항목 | 내용 |
|---|---|
| 버전 | AIX 5.3, AIX 6.1 (6.1에서 다룰 수 있는 파일에 /etc/nscontrol.conf, /etc/security/pwdalg.cfg, rtcd_policy.conf가 더해짐) |
| 원문 | IBM Commands Reference — 5.3 Volume 3, 6.1 Volume 3 |
| 파일 | /usr/bin/lssec, /etc/security/user, /etc/security/login.cfg, /etc/security/lastlog |
| 관련 명령어 | chsec, lsuser, lsgroup, usrck, pwdck |
목적
보안 스탠자 파일의 속성을 나열합니다.
영어 원문
Lists attributes in the security stanza files.
구문
lssec [ -c ] [ -f File ] [ -s Stanza ] [ -a Attribute ... ]
설명
lssec 명령은 보안 구성 스탠자 파일에 저장된 속성을 나열합니다. Attribute 매개변수로 지정할 수 있는 속성은 다음 파일에 있으며, 파일마다 Stanza 매개변수에 줄 수 있는 스탠자 이름이 정해져 있습니다.
| 파일 | 내용 | 스탠자 이름 |
|---|---|---|
/etc/security/user |
사용자의 확장 속성 | 사용자 이름 또는 default |
/etc/security/limits |
사용자별 자원 한도 | 사용자 이름 또는 default |
/etc/security/environ |
사용자의 환경 속성 | 사용자 이름 또는 default |
/etc/security/lastlog |
사용자의 마지막 로그인 속성 | 사용자 이름 또는 default |
/etc/security/passwd |
비밀번호 정보(password 속성은 다룰 수 없음) |
사용자 이름 또는 default |
/etc/security/group |
그룹의 확장 속성 | 그룹 이름 또는 default |
/usr/lib/security/mkuser.default |
새 사용자의 기본값 | admin 또는 user |
/etc/security/login.cfg |
포트 구성, 인증 메서드, 시스템 전체 설정 | 포트 이름, 메서드 이름, usw |
/etc/security/portlog |
포트별 로그인 실패 정보 | 포트 이름 |
/etc/security/audit/hosts |
호스트와 프로세서 ID | |
/etc/security/roles |
역할 목록 | |
/etc/security/user.roles |
사용자별 역할 | |
/etc/security/smitacl.user, smitacl.group |
사용자·그룹 SMIT ACL | |
/etc/nscontrol.conf |
일부 이름 서비스 구성(6.1) | |
/etc/security/pwdalg.cfg |
로드 가능 비밀번호 알고리즘(LPA) 구성(6.1) | |
/etc/security/rtc/rtcd_policy.conf |
rtcd 데몬 구성(6.1) |
/etc/security/passwd의 password 속성은 lssec으로 볼 수 없습니다.
관리 사용자의 lastupdate와 flags 속성은 root나 PasswdAdmin 권한이 있는 사용자만 볼 수 있습니다.
영어 원문
The lssec command lists attributes stored in the security configuration stanza files. The following security configuration files contain attributes that you can specify with the Attribute parameter:
/etc/security/environ
/etc/security/group
/etc/security/audit/hosts
/etc/security/lastlog
/etc/security/limits
/etc/security/login.cfg
/usr/lib/security/mkuser.default
/etc/nscontrol.conf
/etc/security/passwd
/etc/security/portlog
/etc/security/pwdalg.cfg
/etc/security/roles
/etc/security/smitacl.user
/etc/security/smitacl.group
/etc/security/user
/etc/security/user.roles
/etc/security/rtc/rtcd_policy.conf
When listing attributes in the /etc/security/environ, /etc/security/lastlog, /etc/security/limits, /etc/security/passwd, and /etc/security/user files, the stanza name specified by the Stanza parameter must be either a valid user name or default. When listing attributes in the /etc/security/group file, the stanza name specified by the Stanza parameter must be either a valid group name or default. When listing attributes in the /usr/lib/security/mkuser.default file, the Stanza parameter must be either admin or user. When listing attributes in the /etc/security/portlog file, the Stanza parameter must be a valid port name. When listing attributes in the /etc/security/login.cfg file, the Stanza parameter must be either a valid port name, a method name, or the usw attribute.
You cannot list the password attribute of the /etc/security/passwd file with the lssec command.
Only the root user or a user with PasswdAdmin authorization can list the lastupdate and flags attributes for administrative users.
플래그
| 플래그 | 설명 |
|---|---|
-c |
콜론으로 나눈 형식으로 출력합니다. |
-f File |
나열할 스탠자 파일 이름. |
-s Stanza |
나열할 스탠자 이름. |
-a Attribute |
나열할 속성. 여러 번 줄 수 있습니다. |
영어 원문
-c— Specifies that the output should be in colon-separated format.-fFile — Specifies the name of the stanza file to list.-sStanza — Specifies the name of the stanza to list.-aAttribute — Specifies the attribute to list.
보안
접근 제어: 실행 권한은 root와 security 그룹에만 있습니다. 신뢰 컴퓨팅 기반 속성이 있고, 보안 데이터베이스에 접근하려고 root로 setuid해 실행합니다.
RBAC 사용자와 Trusted AIX 사용자는 주의하세요. 이 명령은 특권 작업을 할 수 있으며, 특권 작업은 특권 사용자만 할 수 있습니다. 특권과 권한 목록은 lssecattr 명령이나 getcmdattr 하위 명령으로 봅니다(6.1 문서에만 있음). 명령의 기능을 모두 쓰려면 역할에 accessauths 말고도 aix.security 권한이 있어야 합니다.
Trusted AIX 시스템에서는 aix.mls.clear.read 권한이 있는 사용자만 다른 사용자의 허가 등급 속성을, aix.mls.tty.read 권한이 있는 사용자만 포트 속성을 볼 수 있습니다.
읽는 파일: 위 표의 파일과 /etc/security/domains(6.1의 rtcd_policy.conf는 읽기·쓰기로 적혀 있음).
영어 원문
Access Control: This command grants execute access only to the root user and the security group. The command has the trusted computing base attribute and runs the setuid subroutine for the root user to access the security databases.
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 aix.security authorization.
On a Trusted AIX system, only users with authorization aix.mls.clear.read can list clearance attributes of other users. Only users with authorization aix.mls.tty.read can list port attributes.
Files Accessed:
Mode File r /etc/security/environ r /etc/security/group r /etc/security/audit/hosts r /etc/security/lastlog r /etc/security/limits r /etc/security/login.cfg r /usr/lib/security/mkuser.default r /etc/nscontrol.conf r /etc/security/passwd r /etc/security/portlog r /etc/security/pwdalg.cfg r /etc/security/roles r /etc/security/smitacl.user r /etc/security/smitacl.group r /etc/security/user r /etc/security/user.roles r /etc/security/domains rw /etc/security/rtc/rtcd_policy.conf
예제
- root가 마지막으로 성공한 로그인 뒤 실패한 로그인 수를 봅니다.
$ lssec -f /etc/security/lastlog -s root -a unsuccessful_login_count
root unsuccessful_login_count=15
- 포트
/dev/tty2에 로그인을 허락하는 시간을 봅니다.
$ lssec -f /etc/security/login.cfg -s /dev/tty2 -a logintimes
/dev/tty2 logintimes=!january1,!july4,!december25
tpath와ttys속성의 기본 설정을 콜론 형식으로 봅니다.
$ lssec -c -f /etc/security/user -s default -a tpath -a ttys
#name:tpath:ttys
default:nosak:ALL
자주 쓰는 형태:
lssec -f /etc/security/lastlog -s app1 -a unsuccessful_login_count -a time_last_login
lssec -f /etc/security/user -s default -a maxage -a minlen -a histsize -a loginretries
lssec -f /etc/security/login.cfg -s usw -a pwd_algorithm -a maxlogins
lssec -f /etc/security/limits -s default -a fsize -a nofiles
영어 원문
- To list the number of unsuccessful login attempts by the root user since the last successful login of the root user, enter:
lssec -f /etc/security/lastlog -s root -a unsuccessful_login_count
The system displays the result as follows: root unsuccessful_login_count=15
- To list the times that logins are allowed on the /dev/tty2 port, enter:
lssec -f /etc/security/login.cfg -s /dev/tty2 -a logintimes
The system displays the result as follows:
/dev/tty0 logintimes=!january1,!july4,!december25
- To list the default setting for the tpath attribute and the ttys attribute in colon format, 4. enter:
lssec -c -f /etc/security/user -s default -a tpath -a ttys
The system displays the result as follows:
#name:tpath:ttys
default:nosak:ALL
파일
| 파일 | 설명 |
|---|---|
/usr/bin/lssec |
lssec 명령 |
/etc/security/enc/LabelEncodings |
Trusted AIX의 레이블 정의 |
/etc/security/domains |
시스템의 올바른 도메인 정의 |
그 밖의 파일은 설명 절의 표를 봅니다.
영어 원문
- /usr/bin/lssec — Specifies the path to the lssec command.
- /etc/security/environ — Contains the environment attributes of users.
- /etc/security/group — Contains extended attributes of groups.
- /etc/security/audit/hosts — Contains host and processor IDs.
- /etc/security/lastlog — Defines the last login attributes for users.
- /etc/security/limits — Defines resource quotas and limits for each user.
- /etc/security/login.cfg — Contains port configuration information.
- /usr/lib/security/mkuser.default — Contains the defaults values for new users.
- /etc/nscontrol.conf — Contains configuration information of some name services.
- /etc/security/passwd — Contains password information.
- /etc/security/portlog — Contains unsuccessful login attempt information for each port.
- /etc/security/pwdalg.cfg — Contains configuration information for loadable password algorithms (LPA).
- /etc/security/roles — Contains a list of valid roles.
- /etc/security/smitacl.user — Contains user ACL definitions.
- /etc/security/smitacl.group — Contains group ACL definitions.
- /etc/security/user — Contains the extended attributes of users.
- /etc/security/user.roles — Contains a list of roles for each user.
- /etc/security/enc/LabelEncodings — Contains label definitions for the Trusted AIX system.
- /etc/security/domains — Contains the valid domain definitions for the system.
/etc/security/rtc/rtcd_policy.conf— Contains configuration information for the rtcd daemon
Related information:
- usrck command
- getportattr command
- List of Security and Auditing Subroutines
- Trusted AIX
리눅스(GNU)와 다른 점
리눅스에는 같은 명령이 없고 보안 설정이 여러 파일에 흩어져 있습니다. 비밀번호 기간은 chage -l 사용자와 /etc/login.defs, 로그인 실패는 faillock --user 사용자, 자원 한도는 /etc/security/limits.conf, 비밀번호 규칙은 /etc/security/pwquality.conf를 봅니다.