사이트 내 전체검색
[linux] 유저생성시 디폴트그룹으로 생성하기
로빈아빠
https://cmd.kr/server/331 URL이 복사되었습니다.

본문

유저생성시 디폴트그룹으로 생성하기

보통 솔라리스의 경우 /usr/sbin/useradd abc 라고 하면 그룹이 other 로 설정 하면서 계정을 생성 합니다.
그렇지만 레드햇의 경우 /usr/sbin/useradd abc 라고 하면 그룹이 abc 로 해서 생성 됩니다. 그래서 이 부분이 어떤가 man 페이지를 뒤져 보다가 아래와 같이 알아 내어서 조금 적어봅니다.

man 페이지를 보면
...
-n A group having the same name as the user being added to the system will be created by default. This option will turn off this Red Hat Linux specific behavior
...
Changing the default values
When invoked with the -D option, useradd will either display the current default values, or update the default values from the command line. The valid options are
...

의 내용이 있습니다.

[root@host root]# /usr/sbin/useradd -D GROUP=100 HOME=/home INACTIVE=-1 EXPIRE= SHELL=/bin/bash SKEL=/etc/skel
이락고 나옵니다.

[root@host root]# /usr/sbin/useradd abc -n
라고 하면 디폴트 그룹이 users 로 등록 됩니다. 

/etc/adduser.conf 에서 adduser에 대한 설정을 합니다.[데비안] 레드햇에는 설정파일이 /etc/default/useradd 에 위치합니다.

그 안에 보면 adduser 할 때 그룹을 id와 같은 것으로 할 것인지, default 그룹으로 할 것인지에 대한 기본값을 설정할 수 있습니다.

마찬가지로 default 그룹으로 한다면 어느 그룹을 default로 할 것 인지에 대해서도 설정할 수 있습니다. default 값으려 users 를 하도록 설정되어 있고, 관리자 맘대로 바꿀 수 있습니다.

댓글목록

등록된 댓글이 없습니다.

1,139 (11/23P)

Search

Copyright © Cmd 명령어 3.15.226.33