리눅스 / 명령어 / 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
같은 카테고리의 다른 글

Ubuntu 22.04 Server / ZIP 압축 파일 푸는 방법

ZIP 파일을 압축 해제하기 위해서는 unzip 패키지가 필요하다. # apt install unzip xxx.zip 파일을 압축 해제하려면 다음과 같이 명령한다. # unzip xxx.zip 다음과 같이 명령하여 도움말을 볼 수 있다. # unzip -h 결과는 다음과 같다. UnZip 6.00 of 20 April 2009, by Debian. Original by Info-ZIP. Usage: unzip Default ...

CentOS 7 / YUM 사용법

CentOS 7 / YUM 사용법

YUM 명령어 도움말 보기 yum -h 패키지를 최신 버전으로 업데이트 하기 yum update 모든 패키지 목록을 보기 yum list 모든 패키지 그룹 목록을 보기 yum grouplist http과 관련된 패키지를 검색하기 yum search http 패키지 이름에 http를 포함하고 있는 것을 검색하기 yum list *http* httpd 패키지의 정보 보기 yum info httpd X Window System 패키지 그룹의 정보 보기 yum groupinfo "X Window System" httpd 패키지 설치하기 yum install ...

리눅스 / 명령어 / rmdir / 빈 디렉토리 삭제하는 명령어

rmdir rmdir은 빈 디렉토리를 삭제하는 명령어이다. Remove the DIRECTORY(ies), if they are empty. 사용법 rmdir directory a 디렉토리를 삭제한다. # rmdir a  비어있다면 삭제를 하고, 그렇지 않다면 다음을 출력한다. rmdir: failed to remove ‘a’: Directory not empty rmdir --ignore-fail-on-non-empty directory 디렉토리가 비어있지 않아도 메시지를 출력하지 않는다. rmdir -v directory 현재 디렉토리 안에 있는 모든 비어있는 디렉토리를 삭제한다. v 옵션을 넣으면 작업 결과를 ...

리눅스 / 명령어 / rdate / 타임서버의 시간과 동기화해주는 명령어

rdate는 서버의 시간과 타임서버의 시간을 동기화해주는 명령어이다. rdate는 설치되어있지 않는 경우가 많으므로, 필요하다면 설치를 해야 한다. CentOS라면 # yum install rdate Ubuntu라면 # apt install rdate 와 같이 명령하여 설치할 수 있습니다. 타임서버의 시간을 확인할 때는 -p 옵션을 사용합니다. 현재 서버의 시간을 변경하지 않는다. # rdate -p time.bora.net 현재 서버의 시간을 타임서버의 시간으로 맞출 때에는 -s 옵션을 ...

Ubuntu 20.04 Server / GUI 설치하는 방법

Ubuntu 20.04 Server / GUI 설치하는 방법

Ubuntu Server는 CLI(Command Line Interface) 환경으로 설치된다. 그런데 어떤 작업은 GUI(Graphical Uer Interface) 환경에서 하는 것이 편하다. 만약 GUI 환경이 필요하다면 설치하여 사용할 수 있다. GUI 패키지에는 kubuntu-desktop lubuntu-desktop ubuntu-desktop ubuntu-desktop-minimal xubuntu-desktop 등이 있다. 주로 ubuntu-desktop 또는 ubuntu-desktop-minimal을 사용하는 듯 하다. 예를 들어 ubuntu-desktop-minimal을 설치한다면, 다음과 같이 명령하면 된다. # apt install ubuntu-desktop-minimal Minimal임에도 불구하고 꽤 많은 저장소 공간이 필요하다. After ...

Ubuntu 20.04 Server / Samba / 설치하고 공유 폴더 만드는 방법

Ubuntu 20.04 Server / Samba / 설치하고 공유 폴더 만드는 방법

Samba를 이용하여 Ubuntu Server에 공유 폴더를 만들고, Windows 클라이언트에서 접속하는 방법을 알아본다. Samba 설치 Samba를 설치한다. 설치하면 바로 시작하고, 재부팅을 해도 자동으로 시작한다. apt install samba 공유할 폴더를 만들고 권한을 777로 설정한다. mkdir /sharedfolder chmod 777 /sharedfolder 설정 파일은 /etc/samba/smb.conf이다. 텍스트 에디터로 열고 제일 밑에 다음 코드를 추가한다. 폴더 이름은 sharedfolder이지만, 네트워크에서는 Shared Folder로 보인다. comment = ...

Ubuntu 18.04 / 해상도 변경하는 방법

Ubuntu 18.04 / 해상도 변경하는 방법

Ubuntu 18.04 Desktop에서 해상도 변경하는 방법입니다. 바탕화면에서 마우스 우클릭을 합니다. 를 클릭합니다. 왼쪽 메뉴에서 를 클릭합니다. 왼쪽 메뉴에서 를 클릭하고, 오른쪽에서 해상도를 선택합니다. 오른쪽 위의 버튼을 클릭합니다. 를 클릭합니다.

리눅스 / 명령어 / cd / 다른 디렉토리로 이동하는 명령어

cd는 change directory의 약자로, 다른 디렉토리로 이동하는 명령어이다. cd 현재 로그인한 사용자의 홈 디렉토리로 이동한다. 일반적으로 root 계정이라면 /root로, 사용자 jb 계정이라면 /home/jb로 이동한다. cd ~user user의 홈 디렉토리로 이동한다. 다음과 같이 명령하면 jb 사용자의 홈 디렉토리로 이동한다. # cd ~jb cd 디렉토리명 지정한 디렉토리로 이동한다. 절대경로, 상대경로 다 사용할 수 있다. 다음과 같이 명령하면 /etc 디렉토리로 이동한다. # cd /etc 현재 ...

CentOS 7 / yum으로 phpMyAdmin 설치하는 방법

CentOS 7 / yum으로 phpMyAdmin 설치하는 방법

phpMyAdmin은 MySQL 또는 MariaDB를 관리하는 유용한 툴입니다. 그런데 CentOS 7 기본 패키지에는 포함되어 있지 않습니다. 하지만, EPEL Repo를 추가하면 yum으로 설치하고 업그레이드를 할 수 있습니다. EPEL Repo 추가 yum install epel-release phpMyAdmin 설치 yum install phpmyadmin 설정 파일 /etc/httpd/conf.d/phpMyAdmin.conf 기본 설정은 외부 접속 불가입니다. 접속하는 PC의 IP를 추가하면 외부 접속이 가능합니다. 접속 주소 http://server-ip/phpMyAdmin

CentOS 7 / mod_security 설치하는 방법

CentOS 7 / mod_security 설치하는 방법

mod_security는 아파치 웹서버에 사용할 수 있는 방화벽 모듈입니다. ModSecurity is an open source, cross-platform web application firewall (WAF) module. Known as the "Swiss Army Knife" of WAFs, it enables web application defenders to gain visibility into HTTP(S) traffic and provides a power rules language and API to implement advanced protections. 설치 yum install ...