-
Notifications
You must be signed in to change notification settings - Fork 0
/
sag-pam_group.html
111 lines (111 loc) · 10.5 KB
/
sag-pam_group.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>6.10. pam_group - 그룹 접근 변경 모듈</title><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><link rel="home" href="Linux-PAM_SAG.html" title="Linux-PAM 시스템 관리자 안내서"><link rel="up" href="sag-module-reference.html" title="6장. 모듈 참조 안내서"><link rel="prev" href="sag-pam_ftp.html" title="6.9. pam_ftp - 익명 접속 모듈"><link rel="next" href="sag-pam_issue.html" title="6.11. pam_issue - 사용 프롬프트에 이슈 파일 추가 표시"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">6.10. pam_group - 그룹 접근 변경 모듈</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="sag-pam_ftp.html">이전</a> </td><th width="60%" align="center">6장. 모듈 참조 안내서</th><td width="20%" align="right"> <a accesskey="n" href="sag-pam_issue.html">다음</a></td></tr></table><hr></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="sag-pam_group"></a>6.10. pam_group - 그룹 접근 변경 모듈</h2></div></div></div><div class="cmdsynopsis"><p><code class="command">pam_group.so</code> </p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="sag-pam_group-description"></a>6.10.1. 설명</h3></div></div></div><p>
pam_group은 사용자를 인증하는 게 아니라 (인증 모듈의 크리덴셜
설정 단계에서) 사용자에게 그룹 멤버십을 부여하는 PAM 모듈이다.
사용자가 이용하려는 서비스에 따라 소속을 정할 수 있다.
</p><p>
기본적으로 설정 파일 <code class="filename">/etc/security/group.conf</code>에서
그룹 멤버십 규칙을 가져온다.
</p><p>
이 모듈이 유용한지 여부는 사용자가 접근 가능한 파일 시스템에
달려 있다. 일단 그룹 멤버십이 부여되고 나면 사용자는
제한된 그룹 소유로 <code class="function">setgid</code>
바이너리를 만들려 할 수 있다. 그리고 이후 사용자가 이 그룹 멤버십을
부여받지 못할 때 미리 컴파일 해 둔 그 바이너리로 그룹 멤버십을
다시 얻을 수 있다. 사용자가 접근 가능한 파일 시스템이 여기서
중요한 이유는 파일 시스템이 <span class="emphasis"><em>nosuid</em></span>으로
마운트돼 있으면 사용자가 그런 바이너리 파일을 만들거나 실행할
수 없기 때문이다. 이 모듈을 안전하게 이용하려면 사용자가
쓰기 접근을 할 수 있는 모든 파일 시스템이
<span class="emphasis"><em>nosuid</em></span>로 마운트돼 있어야 한다.
</p><p>
pam_group 모듈은 <code class="filename">/etc/group</code> 파일과
병행해서 동작한다. 이 모듈 동작에 의해 사용자가 그룹을 부여받는 경우
그건 <code class="filename">/etc/group</code>(또는 동등한 파일)의
내용에 <span class="emphasis"><em>더해서</em></span> 부여받는 것이다.
</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="sag-group.conf-description"></a>6.10.2. 설명</h3></div></div></div><p>
pam_group은 사용자를 인증하는 게 아니라 (인증 모듈의 크리덴셜
설정 단계에서) 사용자에게 그룹 멤버십을 부여하는 PAM 모듈이다.
사용자가 이용하려는 서비스에 따라 소속을 정할 수 있다.
</p><p>
이 모듈이 제대로 동작하려면 올바른 형식의
<code class="filename">/etc/security/group.conf</code> 파일이
있어야 한다. 공백은 무시되고 '\'(개행 이스케이프)로 행을
연장할 수 있다. '#' 다음 내용은 행이 끝날 때까지 무시된다.
</p><p>
행 문법은 다음과 같다.
</p><p>
<em class="replaceable"><code>services</code></em>;<em class="replaceable"><code>ttys</code></em>;<em class="replaceable"><code>users</code></em>;<em class="replaceable"><code>times</code></em>;<em class="replaceable"><code>groups</code></em>
</p><p>
첫 번째 필드인 <em class="replaceable"><code>services</code></em> 필드는
규칙이 적용되는 PAM 서비스 이름의 논리식이다.
</p><p>
두 번째 필드인 <em class="replaceable"><code>tty</code></em> 필드는
이 규칙이 적용되는 터미널 이름의 논리식이다.
</p><p>
세 번째 필드인 <em class="replaceable"><code>users</code></em> 필드는
이 규칙이 적용되는 사용자의 논리식, 또는 유닉스 그룹, 또는
사용자 netgroup이다. 그룹 이름 앞에는 '%' 기호가 붙고
netgroup 이름 앞에는 '@' 기호가 붙는다.
</p><p>
논리식이란 개별 선택적으로 토큰 앞에 '!'(논리 not)를 붙이고
'&'(논리 and)나 '|'(논리 or)로 이어 붙인 것이다.
</p><p>
이 항목들에서 단순 와일드카드 '*'를 한 번만 쓸 수 있다.
유닉스 그룹이나 netgroup에는 와일드카드나 논리 연산자를
쓸 수 없다.
</p><p>
<em class="replaceable"><code>times</code></em> 필드를 이용해
"언제" 사용자에게 그룹을 부여할지 지정한다. 날은 두 글자짜리
항목을 연달아 써서 지정한다. 예를 들어 MoTuSa는 월요일, 화요일,
토요일이다. 참고로 요일을 반복하면 해제되므로 MoMo는 아무 날도
지정하지 않은 것이고, MoWk는 월요일을 뺀 평일이다. 쓸 수 있는
두 글자 조합은 Mo Tu We Th Fr Sa Su Wk Wd Al이며, 끝의 둘은 각각
주말과 7일 전체다. 마지막으로 예를 들자면 AlFr는 금요일을 제외한
모든 요일을 뜻한다.
</p><p>
날/시간 범위 각각의 앞에 '!'를 붙여서 "~를 뺀 전체"를
나타낼 수 있다. 시간 범위 부분은 24시간제 HHMM 시간 둘을
하이픈으로 연결한 것이며 각각 시작 시간과 끝 시간을 나타낸다.
(끝 시간이 시작 시간보다 작으면 다음 날에 적용되는 것으로 본다.)
</p><p>
<em class="replaceable"><code>groups</code></em> 필드는 사용자가
멤버십을 물려받는 그룹들의 목록이며 쉼표나 공백으로 항목을 구분한다.
사용자의 요청이 앞의 필드들을 만족시키면 이 그룹들이 추가된다.
</p><p>
규칙이 적용되려면 요청 프로세스가 services+ttys+users 모두를
만족시켜야 한다.
</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="sag-pam_group-options"></a>6.10.3. 옵션</h3></div></div></div><p>이 모듈은 아무 옵션도 받지 않는다.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="sag-pam_group-types"></a>6.10.4. 제공하는 모듈 종류</h3></div></div></div><p>
<code class="option">auth</code> 모듈 타입만 제공한다.
</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="sag-pam_group-return_values"></a>6.10.5. 반환 값</h3></div></div></div><div class="variablelist"><dl class="variablelist"><dt><span class="term">PAM_SUCCESS</span></dt><dd><p>
그룹 멤버십이 부여됐다.
</p></dd><dt><span class="term">PAM_ABORT</span></dt><dd><p>
관련 데이터를 모두 얻지 못했다.
</p></dd><dt><span class="term">PAM_BUF_ERR</span></dt><dd><p>
메모리 버퍼 오류.
</p></dd><dt><span class="term">PAM_CRED_ERR</span></dt><dd><p>
그룹 멤버십이 부여되지 않았다.
</p></dd><dt><span class="term">PAM_IGNORE</span></dt><dd><p>
아무 동작도 하지 않는 <code class="function">pam_sm_authenticate</code>가 호출됐다.
</p></dd><dt><span class="term">PAM_USER_UNKNOWN</span></dt><dd><p>
시스템에서 알지 못하는 사용자다.
</p></dd></dl></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="sag-pam_group-files"></a>6.10.6. 파일</h3></div></div></div><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="filename">/etc/security/group.conf</code></span></dt><dd><p>기본 설정 파일</p></dd></dl></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="sag-group.conf-examples"></a>6.10.7. 예시</h3></div></div></div><p>
다음은 <code class="filename">/etc/security/group.conf</code>에
지정할 수 있는 예시 몇 가지다.
</p><p>
tty*(모든 ttyXXX 장치)에서 'xsh'을 돌리는 사용자 'us'가 (floppy 그룹
멤버십을 통해) 플로피 디스크 접근 권한을 얻는다.
</p><pre class="programlisting">xsh;tty*&!ttyp*;us;Al0000-2400;floppy</pre><p>
tty*(모든 ttyXXX 장치)에서 'xsh'을 돌리는 사용자 'sword', 'pike',
'shield'가 일과 시간 후에 (games 및 sound 그룹 멤버십을 통해) 게임
접근 권한을 얻는다.
</p><pre class="programlisting">
xsh; tty* ;sword|pike|shield;!Wk0900-1800;games, sound
xsh; tty* ;*;Al0900-1800;floppy
</pre><p>
tty*에서 'xsh'을 돌리는 'admin' 그룹의 모든 사용자가
(항상) 'plugdev' 그룹에 대한 접근권을 부여받는다.
</p><pre class="programlisting">
xsh; tty* ;%admin;Al0000-2400;plugdev
</pre></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="sag-pam_group-authors"></a>6.10.8. 작성자</h3></div></div></div><p>
Andrew G. Morgan <morgan@kernel.org>이 pam_group을 작성했다.
</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="sag-pam_ftp.html">이전</a> </td><td width="20%" align="center"><a accesskey="u" href="sag-module-reference.html">위</a></td><td width="40%" align="right"> <a accesskey="n" href="sag-pam_issue.html">다음</a></td></tr><tr><td width="40%" align="left" valign="top">6.9. pam_ftp - 익명 접속 모듈 </td><td width="20%" align="center"><a accesskey="h" href="Linux-PAM_SAG.html">대문</a></td><td width="40%" align="right" valign="top"> 6.11. pam_issue - 사용자 프롬프트에 이슈 파일 추가 표시</td></tr></table></div></body></html>