리눅스 / 명령어 / passwd / 사용자 암호 설정 명령어

사용자의 비밀번호 설정은 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
같은 카테고리의 다른 글

리눅스 / 명령어 / which, whereis, locate / 명령어 위치 찾기

명령어의 위치를 찾을 때 사용할 수 있는 명령어에는 which, whereis, locate가 있다. 명령어의 위치만 찾을 때는 which를 사용하고, 관련된 파일들의 위치까지 찾을 때는 whereis나 locate를 사용한다. which 명령어로 find 명령어를 찾는다. # which find /usr/bin/find whereis 명령어로 find 명령어를 찾는다. # whereis find find: /usr/bin/find /usr/share/man/man1/find.1.gz locate 명령어로 find 명령어를 찾는다. # locate find /usr/bin/find /usr/bin/find2perl /usr/bin/findmnt /usr/bin/nl-link-ifindex2name /usr/bin/nl-link-name2ifindex /usr/bin/oldfind /usr/lib64/python2.7/modulefinder.py /usr/lib64/python2.7/modulefinder.pyc /usr/lib64/python2.7/modulefinder.pyo /usr/sbin/btrfs-find-root /usr/sbin/findfs /usr/share/bash-completion/completions/findmnt /usr/share/doc/findutils-4.5.11 /usr/share/doc/findutils-4.5.11/AUTHORS /usr/share/doc/findutils-4.5.11/COPYING /usr/share/doc/findutils-4.5.11/ChangeLog /usr/share/doc/findutils-4.5.11/NEWS /usr/share/doc/findutils-4.5.11/README /usr/share/doc/findutils-4.5.11/THANKS /usr/share/doc/findutils-4.5.11/TODO /usr/share/doc/wpa_supplicant-2.6/examples/p2p/p2p_find.py /usr/share/doc/wpa_supplicant-2.6/examples/p2p/p2p_stop_find.py /usr/share/info/find-maint.info.gz /usr/share/info/find.info.gz /usr/share/locale/be/LC_MESSAGES/findutils.mo /usr/share/locale/bg/LC_MESSAGES/findutils.mo /usr/share/locale/ca/LC_MESSAGES/findutils.mo /usr/share/locale/cs/LC_MESSAGES/findutils.mo /usr/share/locale/da/LC_MESSAGES/findutils.mo /usr/share/locale/de/LC_MESSAGES/findutils.mo /usr/share/locale/el/LC_MESSAGES/findutils.mo /usr/share/locale/eo/LC_MESSAGES/findutils.mo /usr/share/locale/es/LC_MESSAGES/findutils.mo /usr/share/locale/et/LC_MESSAGES/findutils.mo /usr/share/locale/fi/LC_MESSAGES/findutils.mo /usr/share/locale/fr/LC_MESSAGES/findutils.mo /usr/share/locale/ga/LC_MESSAGES/findutils.mo /usr/share/locale/gl/LC_MESSAGES/findutils.mo /usr/share/locale/hr/LC_MESSAGES/findutils.mo /usr/share/locale/hu/LC_MESSAGES/findutils.mo /usr/share/locale/id/LC_MESSAGES/findutils.mo /usr/share/locale/it/LC_MESSAGES/findutils.mo /usr/share/locale/ja/LC_MESSAGES/findutils.mo /usr/share/locale/ko/LC_MESSAGES/findutils.mo /usr/share/locale/lg/LC_MESSAGES/findutils.mo /usr/share/locale/lt/LC_MESSAGES/findutils.mo /usr/share/locale/ms/LC_MESSAGES/findutils.mo /usr/share/locale/nl/LC_MESSAGES/findutils.mo /usr/share/locale/pl/LC_MESSAGES/findutils.mo /usr/share/locale/pt/LC_MESSAGES/findutils.mo /usr/share/locale/pt_BR/LC_MESSAGES/findutils.mo /usr/share/locale/ro/LC_MESSAGES/findutils.mo /usr/share/locale/ru/LC_MESSAGES/findutils.mo /usr/share/locale/rw/LC_MESSAGES/findutils.mo /usr/share/locale/sk/LC_MESSAGES/findutils.mo /usr/share/locale/sl/LC_MESSAGES/findutils.mo /usr/share/locale/sr/LC_MESSAGES/findutils.mo /usr/share/locale/sv/LC_MESSAGES/findutils.mo /usr/share/locale/tr/LC_MESSAGES/findutils.mo /usr/share/locale/uk/LC_MESSAGES/findutils.mo /usr/share/locale/vi/LC_MESSAGES/findutils.mo /usr/share/locale/zh_CN/LC_MESSAGES/findutils.mo /usr/share/locale/zh_TW/LC_MESSAGES/findutils.mo /usr/share/man/man1/find.1.gz /usr/share/man/man1/find2perl.1.gz /usr/share/man/man1/oldfind.1.gz /usr/share/man/man8/btrfs-find-root.8.gz /usr/share/man/man8/findfs.8.gz /usr/share/man/man8/findmnt.8.gz locate 명령어는 -n 옵션으로 출력 ...

리눅스 / 명령어 / rm / 파일 또는 디렉토리 삭제하는 명령어

rm은 remove의 약자로, 파일 또는 디렉토리를 삭제하는 명령어이다. 파일 삭제하기 abc.txt 파일을 삭제한다. 삭제할 건지 다시 묻는다. y 또는 yes를 입력하면 삭제한다. # rm abc.txt 확장자가 txt인 모든 파일을 삭제한다. 각 파일에 대해서 삭제할 건지 묻는다. # rm *.txt 현재 디렉토리에 있는 모든 파일을 삭제한다. 각 파일에 대해서 삭제할 건지 묻고, 디렉토리가 있다면 삭제할 수 없다는 ...

리눅스 / 커널 / 버전 확인하는 방법

리눅스 커널 버전을 확인하는 방법은 여러 가지가 있습니다. 그 중 자주 사용하는 방법 두 가지를 소개합니다. uname uname 명령어는 시스템 정보를 출력하는 데 사용됩니다. -r 옵션을 사용하여 커널 버전을 확인할 수 있습니다. # uname -r 6.8.0-35-generic hostnamectl hostnamectl 명령어는 시스템의 호스트 이름과 관련된 정보를 관리하고 표시합니다. 여기에는 커널 버전 정보도 포함됩니다. # hostnamectl Static hostname: ubuntu-24-01 ...

워드프레스 / 무료 테마 구할 수 있는 사이트 모음

워드프레스 / 무료 테마 구할 수 있는 사이트 모음

워드프레스 무료 테마는 WordPress.ORG에서 구하는 것이 제일 쉽다. 관리자 페이지에서 설치와 업데이트를 바로 할 수 있기 때문이다. 또다른 방법은 워드프레스 테마를 무료로 배포하는 사이트를 찾는 것이다. 워드프레스는 세계적으로 널리 쓰이는 CMS라, 무료로 테마를 배포하는 사이트도 많다. 무료 테마를 사용할 때 주의할 점은... Free이고, 바로 다운로드 받을 수 있어도, 라이센스를 다시 한번 확인하는 것이 ...

인텔 10세대 또는 11세대 노트북에 윈도우 설치할 때 드라이브가 없는 문제 해결하는 방법

인텔 10세대 또는 11세대 노트북에 윈도우 설치할 때 드라이브가 없는 문제 해결하는 방법

인텔 11세대 CPU를 탑재한 노트북을 샀다. HP 빅터스 계열로, 가성비 좋은 게이밍 노트북이다. 프리 도스 제품을 샀기에 제일 먼저 한 것은 윈도우를 설치하는 것. 설치용 USB를 만들고, 바이오스에서 부팅 순서 변경하고, 설치를 시작했는데... 윈도우를 설치할 저장소(드라이브)가 없다고 나온다. 꽤 많은 컴퓨터를 만져보고 수없이 윈도우를 설치했는데, 이런 적은 처음이다. 그 중에는 다른 ...

국세청 홈택스 / 연말정산간소화 서비스에서 연말정산자료 출력하는 방법

국세청 홈택스 / 연말정산간소화 서비스에서 연말정산자료 출력하는 방법

근로자는 매년 초 전년도 근로소득에 대해서 연말정산을 합니다. 이때 소득공제 또는 세액공제를 받기 위해서 보험료, 교육비, 신용카드 사용액 등을 제출을 하죠. 사실 꼭 해야 하는 것은 아닙니다. 5월 달 종합소득세 신고 때 해도 되니까요. 하지만, 년 초에 하면 회시에서 처리해주고, 돈을 받을 게 있다면 미리 받는다는 장점이 있죠. 연말정산 관련 자료는 ...

네트워크 / TTL(Time To Live)

네트워크 / TTL(Time To Live)

개요 TTL은 Time To Live의 약자로, IP 패킷 헤더의 한 필드이다. TTL 필드는 패킷이 네트워크를 통해 전달될 때 패킷이 머무를 수 있는 최대 홉(hop) 수를 지정한다. 이 필드는 패킷이 무한히 순환하지 않도록 방지하는 데 사용된다. TTL의 동작 방식은 다음과 같다. 패킷이 네트워크를 통해 전송될 때 송신자는 TTL 값을 설정한다. 이 값은 일반적으로 64, ...

사진 파일 이름 일괄 변경 해주는 프로그램 / FreeCommander, 알씨, PhotoScape X

사진 파일 이름 일괄 변경 해주는 프로그램 / FreeCommander, 알씨, PhotoScape X

사진을 찍으면 자동으로 파일 이름이 생성된다. DSLR인 EOS 650D와 아이패드는 IMG로 시작하고 뒤에 일련번호가 붙는다. IMG_0001.jpg 넥서스5는 IMG 뒤에 찍은 날짜와 시간이 붙는다. IMG_20150322_123456.jpg 오래전에 구입했던 삼성 디카는 S 뒤에 일련번호가 붙는다. S5002978.jpg 사진이 잔뜩 쌓이니 서로 다른 규칙의 이름이 상당히 불편하다. 모든 사진 파일의 이름이 일정한 규칙을 따른다면 훨씬 관리하기 편할 것이다. 아래의 프로그램을 이용하면, 쉽게 ...

버추얼박스 / 가상 머신 내보내기, 가져오기

버추얼박스 / 가상 머신 내보내기, 가져오기

버추얼박스의 가상 머신을 백업하고 복원하는 방법 중의 하나는 내보내기와 가져오기를 이용하는 것입니다. 내가 만든 가상 머신을 남에게 전달할 때도 유용한 방법입니다. 내보내기는 가상 머신의 모든 구성 요소를 하나의 파일로 만드는 것이라 파일의 크기가 상당히 큰데, SSD라면 꽤 빠른 시간에 끝납니다. 가져오기도 마찬가지입니다. 내보내기 왼쪽 위의 을 클릭합니다. 를 클릭합니다. 단축키는 Ctrl+E입니다. 내보낼 가상 ...

버추얼박스 / 공유 폴더 만드는 방법

버추얼박스 / 공유 폴더 만드는 방법

버추얼박스에서 호스트와 게스트 간 파일을 주고 받는 방법 중 가장 쉬운 것은 드래그 앤 드롭을 이용하는 것입니다. 그런데 단점이 있습니다. 게스트에서 수정한 파일을 호스트에서 사용하려면 또 옮겨야 하고, 호스트에서 수정한 파일을 게스트에서 사용하려면 또 옮겨야 합니다. 호스트와 게스트가 동시에 사용하면서 수정이 잦다면, 드래그 앤 드롭보다 공유 폴더를 이용하는 것이 더 ...