계정 정보 관련 리눅스/유닛스 명령어




chage 


NAME
       chage - change user password expiry information

SYNOPSIS
       chage [options] user

DESCRIPTION
       The chage command changes the number of days between password changes and the date of the last password change. This information is used by the system to
       determine when a user must change his/her password.

기본적으로 루트권한이 필요.
사용자의 만료일을 변경합니다.
비밀번호 만료일, 계정 만료일 등




[root@repo ~]# chage
사용법: chage [옵션] <사용자>

옵션:
  -d, --lastday <최근날짜>      최근 열쇠글을 변경한 날짜를 <최근날짜>로 합니다.
  -E, --expiredate <만료날짜>   계정 만료날짜를 <만료날짜>로 합니다.
  -h, --help                    이 도움말을 표시하고 끝냅니다.
  -I, --inactive <비활성화기간> 만료된 후 비활성화 기간을 <비활성화기간>으로 합니다
  -l, --list                    계정의 사용기한 정보를 표시합니다.
  -m, --mindays <최소날수>      열쇠글을 바꾸기 전의 최소 날 수를 <최소날수>로 합니다. //해당일이 경과 후 비밀번호(열쇠글)을 바꿀 수 있습니다.
  -M, --maxdays <최대날수>      열쇠글을 바꾸기 전의 최대 날 수를 <최대날수>로 합니다.//해당일이 경과 후엔 비밀번호(열쇠글)을 더이상 바꿀 수 있습니다. (즉, 사용불가 상태가됨)
  -W, --warndays <경고날수>     만료 경고 기간을 <경고날수>으로 합니다.


[root@repo ~]# chage
Usage: chage [options] user

Options:
  -d, --lastday LAST_DAY        set last password change to LAST_DAY
  -E, --expiredate EXPIRE_DATE  set account expiration date to EXPIRE_DATE
  -h, --help                    display this help message and exit
  -I, --inactive INACTIVE       set password inactive after expiration
                                to INACTIVE
  -l, --list                    show account aging information
  -m, --mindays MIN_DAYS        set minimum number of days before password
                                change to MIN_DAYS
  -M, --maxdays MAX_DAYS        set maximim number of days before password
                                change to MAX_DAYS
  -W, --warndays WARN_DAYS      set expiration warning days to WARN_DAYS


ex>
  • user에 대한 정보를 봄
    • # chage -l user
      마지막으로 열쇠글을 바꾼 날                                     : 4월 10, 2012
      열쇠글 만료                                     : 4월 10, 2013
      열쇠글이 비활성화 기간                                  :안함
      계정 만료                                               : 1월 01, 2013
      열쇠글을 바꿀 수 있는 최소 날 수                : 0
      열쇠글을 바꿔야 하는 최대 날 수         : 365
      열쇠글 만료 예고를 하는 날 수           : 10
  • 대화형
    • # chage user
      • mins01의 사용기한 정보를 바꿉니다
        새로운 값을 넣거나, 기본값을 원하시면 엔터를 치세요

                열쇠글의 최소 유효 기간 [0]:
                열쇠글의 최대 유효 기간 [365]:
                마지막으로 열쇠글을 바꾼 날 (YYYY-MM-DD) [2012-04-10]:
                열쇠글 사용만료 예고 [10]:
                열쇠글이 유효하지 않음 [-1]:
                계정 사용만료일(YYYY-MM-DD) [2013-01-01]: 




usermod 


NAME
       usermod - modify a user account

SYNOPSIS
       usermod [options] LOGIN

DESCRIPTION
       The usermod command modifies the system account files to reflect the changes that are specified on the command line.

계정 정보를 변경



[root@repo ~]# usermod 
Usage: usermod [options] LOGIN

Options:
  -a, --append                  append the user to the supplemental GROUPS
                                (use only with -G)
  -c, --comment COMMENT         new value of the GECOS field
  -d, --home HOME_DIR           new home directory for the user account
  -e, --expiredate EXPIRE_DATE  set account expiration date to EXPIRE_DATE
  -f, --inactive INACTIVE       set password inactive after expiration
                                to INACTIVE
  -g, --gid GROUP               force use GROUP as new primary group
  -G, --groups GROUPS           new list of supplementary GROUPS
  -h, --help                    display this help message and exit
  -l, --login NEW_LOGIN         new value of the login name
  -L, --lock                    lock the user account
  -m, --move-home               move contents of the home directory to the new
                                location (use only with -d)
  -o, --non-unique              allow using duplicate (non-unique) UID
  -p, --password PASSWORD       use encrypted password for the new password
  -s, --shell SHELL             new login shell for the user account
  -u, --uid UID                 new UID for the user account
  -U, --unlock                  unlock the user account
  -Z, --selinux-user    new selinux user mapping for the user account


ex>
  • user의 계정 만료일을 변경
    • # usermod --expiredate 2013-01-01 user
    • 작업후 chage -l user 로 확인을 해보시오.


댓글
  • No Nickname
    No Comment
  • 권한이 없습니다.
    {{m_row.m_nick}}
    -
목록형 📅 달력형