3 분 소요

📝 패스워드 정책

  • 대/소문자, 숫자, 특수문자를 혼용하여 8 글자 이상의 패스워드를 사용
  • 동일 문자를 연속 4회 이상 사용하기 금지
  • 패스워드 히스토리를 관리해 2~3개 이상 동일 패스워드를 사용 금지
  • 패스워드 변경 주기를 설정 (패스워드 유효기간을 90일 이하로 설정)
  • 사전에 나오는 쉬운 단어나 이름은 패스워드로 사용하지 못하도록 설정
  • 기본 설정된 패스워드는 사용하지 못하도록 설정
  • 초기 부여된 패스워드는 사용자 최초 접속시 변경하도록 설정

/etc/security/pwquality.conf 패스워드 정책 설정 파일

# Configuration for systemwide password quality limits
# Defaults:
#
# Number of characters in the new password that must not be present in the
# old password.
# difok = 5
#
# Minimum acceptable size for the new password (plus one if
# credits are not disabled which is the default). (See pam_cracklib manual.)
# Cannot be set to lower value than 6.
# minlen = 9
#
# The maximum credit for having digits in the new password. If less than 0
# it is the minimum number of digits in the new password.
# dcredit = 1
#
# The maximum credit for having uppercase characters in the new password.
# If less than 0 it is the minimum number of uppercase characters in the new
# password.
# ucredit = 1
#
# The maximum credit for having lowercase characters in the new password.
# If less than 0 it is the minimum number of lowercase characters in the new
# password.
# lcredit = 1
#
# The maximum credit for having other characters in the new password.
# If less than 0 it is the minimum number of other characters in the new
# password.
# ocredit = 1
#
# The minimum number of required classes of characters for the new
# password (digits, uppercase, lowercase, others).
# minclass = 0
#
# The maximum number of allowed consecutive same characters in the new password.
# The check is disabled if the value is 0.
# maxrepeat = 0
#
# The maximum number of allowed consecutive characters of the same class in the
# new password.
# The check is disabled if the value is 0.
# maxclassrepeat = 0
#
# Whether to check for the words from the passwd entry GECOS string of the user.
# The check is enabled if the value is not 0.
# gecoscheck = 0
#
# Path to the cracklib dictionaries. Default is to use the cracklib default.
# dictpath =


/etc/login.defs 패스워드 기본값 설정 파일

#
# Please note that the parameters in this configuration file control the
# behavior of the tools from the shadow-utils component. None of these
# tools uses the PAM mechanism, and the utilities that use PAM (such as the
# passwd command) should therefore be configured elsewhere. Refer to
# /etc/pam.d/system-auth for more information.
#

# *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 for automatic uid selection in useradd
#
UID_MIN                  1000
UID_MAX                 60000
# System accounts
SYS_UID_MIN               201
SYS_UID_MAX               999

#
# Min/max values for automatic gid selection in groupadd
#
GID_MIN                  1000
GID_MAX                 60000
# System accounts
SYS_GID_MIN               201
SYS_GID_MAX               999

#
# 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 should 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 SHA512 to encrypt password.
ENCRYPT_METHOD SHA512


패스워드를 변경할 때 사용하는 passwd 명령어

  • passwd [사용자명]
  • 해당 사용자의 패스워드 변경
  • 사용자명을 입력하지 않으면 현재 사용자의 패스워드로 변경
    • -n : 패스워드 변경 후 최소 사용 시간
    • -x : 패스워드 변경 후 최대 사용 기간
    • -w : 패스워드 만기일 이전에 사용자에게 경고 메시지를 전달할 날짜 지정
    • -f : 최초 로그인시에 강제로 패스워드를 변경하도록 설정
    • -d : shadow 파일의 패스워드 필드 값을 제거, passwd 입력 없이 로그인 가능
    • -l : 해당 사용자의 상태를 locking으로 변경
    • -s : 해당 사용자의 현재 패스워드 설정 조회

태그:

카테고리:

업데이트:

댓글남기기