(10101101)173/UNIX2009. 4. 26. 20:45
/etc/default/useradd파일 외에도 또 다른 곳에서 useradd명령어가 참조하는 파일이 있습니다. /etc/login.defs파일이 주인공 입니다. 아래는 파일의 내용 입니다.
[root@FC10VM /]# cat /etc/login.defs
# *REQUIRED*
#
Directory where mailboxes reside, _or_ name of file, relative to the
#
home directory.  If you _do_ define both, MAIL_DIR takes precedence.
#
QMAIL_DIR is for Qmail
#
#QMAIL_DIR
Maildir
MAIL_DIR
  /var/spool/mail
#MAIL_FILE
.mail

# Password aging controls:
#
#
PASS_MAX_DAYS Maximum number of days a password may be used.
#
PASS_MIN_DAYS Minimum number of days allowed between password changes.
#
PASS_MIN_LEN   Minimum acceptable password length.
#
PASS_WARN_AGE Number of days warning given before a password expires.
#
PASS_MAX_DAYS
99999
PASS_MIN_DAYS
0
PASS_MIN_LEN
  5
PASS_WARN_AGE
7

#
# Min/max values fore automatic uid selection in useradd
#
UID_MIN
     500
UID_MAX
  60000

#
# Min/max values for automatic gid selection in groupadd
#
GID_MIN
     500
GID_MAX
  60000

#
# If defined, this command is run when removing a user.
# It should remove any at/cron/print jobs etc. owned by
# the user to be removed (passed as the first argument).
#
#USERDEL_CMD
/usr/sbin/userdel_local

#
# If useradd shuold create home directories for users by default
# On RH systems, we do. This option is overridden with the -m flag on
# useradd command line.
#
CREATE_HOME
yes

# The permission mask is initialized to this value. If not specified,
# the permission mask will be initialized to 022.
UMASK
077

# This enables userdel to remove user groups if no members exist.
#
USERGROUPS_ENAB
yes

# Use MD5 or DES to encrypt password? Red Hat use MD5 by default.
MD%_CRYPT_ENAB
no

ENCRYPT_METHOD
SHA512
[표1. /etc/login.defs 파일의 내용]

옵션 설명
MAIL_DIR 계정 사용자의 메일파일이 저장될 위치를 지정 합니다.
PASS_MAX_DAYS 암호변경 최대 일수를 지정 합니다.
PASS_MIN_DAYS 암호변경 최소 일수를 지정 합니다.
PASS_MIN_LEN 허용할 수 있는 최소한의 패스워드 길이를 지정 합니다. (현재 설정은 5자 이상 입력해야 함)
PASS_WARN_AGE 암호변경 경고 일수를 지정합니다. (현재 설정은 7일 이전부터 경고)
UID_MIN (useradd 명령어)사용자 계정 생성시 시작되는 최소 UID 범위
UID_MAX (useradd 명령어)사용자 계정 생성시 최대 UID 범위
(useradd -u 60001 testAcc와 같이 입력할 경우 옵션이 우선되어 UID_MAX최대 값보다
크개 설정할 수 있습니다.)
GID_MIN (groupadd 명령어)사용자 계정 생성시 시작되는 최소 GID 범위
GID_MAX (groupadd 명령어)사용자 계정 생성시 최대 GID 범위
USERDEL_CMD 계정을 삭제하려 할때(userdel 명령어) 로그온 중이거나 해당 계정에 의해 실행되고 있는
프로세스가 있다면 계정을 삭제할 수 없다고 나옵니다. 이런 경우를 위해 userdel 명령어가
실행되기 전에 실행할 프로그램을 설정합니다.
CREATE_HOME (useradd 명령어)사용자 계정 생성시 사용자 홈을 만들지 설정합니다.
UMASK 사용자 계정 생성시 홈 디렉토리의 UMASK값을 설정합니다.
(현재 설정은 777 - 077 = 700, 홈 디렉토리의 권한은 700입니다.
[표 2. /etc/login.defs 파일 설명]



Posted by Special Alex