Skip to content

2008.12.14 14:08

useradd (환경설정파일)

조회 수 22546 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
adduser 명령어로 새로운 사용자를 추가하게되면
vi /etc/default/useradd 의 내용을 기본값으로사용하게된다.

아래의 내용은 redhat 7.1 에서의 default 값이다.

   # useradd defaults file
     GROUP=100
     HOME=/home
     INACTIVE=-1
     EXPIRE=
     SHELL=/bin/bash
     SKEL=/etc/skel

   [설명]

   * GROUP=100
     기본 그룹 ID 가 100 으로 설정되어있다는 뜻이다. 이 값은 개인 그룹이 생기기않도록
     해 두었을때만 사용되는 값이다. 이는 /etc/group 에 있는 값이어야한다.

     일반적으로 웹호스팅에서는 개인 그룹을 허용하지 않는다. 이때 이 부분이 필요하다.
     모든 사용자의 그룹을 user 라는 그룹으로 설정하게된다.
    
   * HOME=/home
     추가된 사용자의 home 디렉토리의 상위디렉토리를 나타낸다.

   * INACTIVE=-1
     패스워드 유효기간이 만료된후 언제 이 계정을 사용할수 없게되는지를 하루단위로 설정한다.
     -1 은 결코 계정이 취소되지 않는다는 것이다.

   * EXPIRE=
     언제 사용자계정이 만료되어서 사용할수없게 되는지를 나타낸다.
     shadow 패스워드를 사용할때만 적용되는 부분이다. 기본적으로 계정은 만료하지 않으므로
     설정값이 없다.

위내용의 기본적인값은 /etc/login.defs 파일에서 가져와서 사용자를 추가할때 사용된다.

아래는 redhat 7.1 에서의 login.defs 파일이다.

     # *REQUIRED*
     #   Directory where mailboxes reside, _or_ name of file, relative to the
     #   home directory.  If you _do_ define both, MAIL_DIR takes precedence.
     #   QMAIL_DIR is for Qmail
     #
     #QMAIL_DIR      Maildir
     MAIL_DIR        /var/spool/mail   => mail 디렉토리 정의
     #MAIL_FILE      .mail

     # Password aging controls:
     #
     #       PASS_MAX_DAYS   Maximum number of days a password may be used.
     #       PASS_MIN_DAYS   Minimum number of days allowed between password changes.
     #       PASS_MIN_LEN    Minimum acceptable password length.
     #       PASS_WARN_AGE   Number of days warning given before a password expires.
     #
     PASS_MAX_DAYS   99999 => 패스워드 최대 사용 시간
     PASS_MIN_DAYS   0     => 패스워드 변경최소 시간
     PASS_MIN_LEN    5     => 패스워드 최소 길이
     PASS_WARN_AGE   7     => 패스워드 소멸전 경고출력 날짜

     #
     # Min/max values for automatic uid selection in useradd
     #
     UID_MIN                   500  => 최소 UID 값
     UID_MAX                 60000  => 최대 UID 값

     #
     # Min/max values for automatic gid selection in groupadd
     #
     GID_MIN                   500  => 최소 GID 값
     GID_MAX                 60000  => 최대 GID 값

     #
     # If defined, this command is run when removing a user.
     # It should remove any at/cron/print jobs etc. owned by
     # the user to be removed (passed as the first argument).
     #
     #USERDEL_CMD    /usr/sbin/userdel_local

     #
     # If useradd should create home directories for users by default
     # On RH systems, we do. This option is ORed with the -m flag on
     # useradd command line.
     #
     CREATE_HOME     yes   => 홈디렉토리 생성여부

Copyright ADMINPLAY corp. All rights reserved.

abcXYZ, 세종대왕,1234

abcXYZ, 세종대왕,1234