리눅스

리눅스/계정, 그룹, 권한설정

우진샘 2011. 3. 11. 19:33

http://www.ahinc.com/linux101/users.htm

useradd - 계정 등록

Options:

  • -d 홈 디렉토리
  • -s 시작할 쉘(shell)
  • -p 패스워드
  • -g 주그룹
  • -G 부그룹
  • -m 사용자 디렉토리 생성

Example: To add a new user with

  • 주그룹 users
  • 부그룹 mgmt
  • 시작 쉘 /bin/bash
  • 패스워드 xxxx
  • 디렉토리 roger
  • 디렉토리생성
  • 유저이름 roger

useradd -gusers -Gmgmt -s/bin/shell -pxxxx -d/home/roger -m roger


usermod - 계정 수정

Options:

  • -d 홈 디렉토리
  • -s 시작할 쉘(shell)
  • -p 패스워드
  • -g 주그룹
  • -G 부그룹

Example: To add the group 'others' to the user roger

usermod -Gothers roger


userdel - 계정 삭제

Options:

  • -r 홈 디렉토리 제거

Example: To remove the user 'roger' and his home directory

userdel -r roger

Options:

  • user's name 

Example: To change the password for the account you are currently logged in as...

passwd
Enter existing password
Enter new password
Enter new password again (to validate)

Example: To change the password for the user 'roger' (only you are logged in as root)...

passwd roger
Enter existing password (can be either roger's password or root's password)
Enter new password
Enter new password again (to validate)


id - 그룹 확인

Options:

  • user's name 

Example: To change the password for the account you are currently logged in as...

id