리눅스 / 명령어 / passwd / 사용자 암호 설정 명령어
                                                      Created 2022-10-16
                                                                                Last Modified 2022-10-16
                                                  
                                          사용자의 비밀번호 설정은 passwd 명령어로 한다.
비밀번호 만들기, 변경하기
- 사용자 jb의 비밀번호를 만들거나 변경한다.
 
passwd jb
사용자을 적지 않으면 현재 로그인한 사용자의 비밀번호를 만들거나 변경한다.
비밀번호 삭제하기
- 사용자 jb의 비밀번호를 삭제한다. 사용자는 비밀번호 입력 없이 로그인 가능하다.
 
passwd -d jb
비밀번호 잠그기, 잠금 풀기
- 사용자 jb를 잠근다. 즉, 사용자는 로그인하지 못한다.
 
passwd -l jb
- 사용자 jb의 잠금을 푼다.
 
passwd -u jb
비밀번호 만료시키기
- 사용자 jb의 비밀번호를 만료시킨다. 로그인하면 비밀번호를 변경하라고 한다.
 
passwd -e jb
사용법 출력하기
- 사용법과 옵션을 출력한다.
 
passwd -h
- 결과는 다음과 같다.
 
Usage: passwd [options] [LOGIN]
Options:
  -a, --all                     report password status on all accounts
  -d, --delete                  delete the password for the named account
  -e, --expire                  force expire the password for the named account
  -h, --help                    display this help message and exit
  -k, --keep-tokens             change password only if expired
  -i, --inactive INACTIVE       set password inactive after expiration
                                to INACTIVE
  -l, --lock                    lock the password of the named account
  -n, --mindays MIN_DAYS        set minimum number of days before password
                                change to MIN_DAYS
  -q, --quiet                   quiet mode
  -r, --repository REPOSITORY   change password in REPOSITORY repository
  -R, --root CHROOT_DIR         directory to chroot into
  -S, --status                  report password status on the named account
  -u, --unlock                  unlock the password of the named account
  -w, --warndays WARN_DAYS      set expiration warning days to WARN_DAYS
  -x, --maxdays MAX_DAYS        set maximum number of days before password
                                change to MAX_DAYS

