1 .\" Copyright (c) 2007 by Michael Kerrisk <mtk.manpages@gmail.com>
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date. The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein. The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" 2007-06-13 Creation
25 .\" Japanese Version Copyright (c) 2007 Akihiro MOTOKI all rights reserved.
26 .\" Translated 2007-10-25, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v2.66
27 .\" Updated 2008-08-04, Akihiro MOTOKI, LDP v3.05
29 .TH CREDENTIALS 7 2008-06-03 "Linux" "Linux Programmer's Manual"
32 .\"O credentials \- process identifiers
33 credentials \- 認証に用いられるプロセスの識別子
36 .\"O .SS Process ID (PID)
38 .\"O Each process has a unique nonnegative integer identifier
39 .\"O that is assigned when the process is created using
41 .\"O A process can obtain its PID using
43 .\"O A PID is represented using the type
46 .\"O .IR <sys/types.h> ).
47 各プロセスは、負でない整数の一意な識別子を持つ。
50 を使ってプロセスが生成される際に割り当てられる。
62 .\"O PIDs are used in a range of system calls to identify the process
63 .\"O affected by the call, for example:
64 PID は各種のシステムコールでそのシステムコールが作用するプロセスを
65 特定するために使用される。以下に例を挙げる:
69 .\" .BR sched_rr_get_interval (2),
70 .\" .BR sched_getaffinity (2),
71 .\" .BR sched_setaffinity (2),
72 .\" .BR sched_getparam (2),
73 .\" .BR sched_setparam (2),
74 .\" .BR sched_setscheduler (2),
75 .\" .BR sched_getscheduler (2),
85 .\"O A process's PID is preserved across an
90 .\"O .SS Parent Process ID (PPID)
92 .\"O A process's parent process ID identifies the process that created
93 .\"O this process using
95 .\"O A process can obtain its PPID using
97 .\"O A PPID is represented using the type
101 を使ってそのプロセスを生成したプロセスを示す。
109 .\"O A process's PPID is preserved across an
114 .\"O .SS Process Group ID and Session ID
115 .SS プロセスグループ ID とセッション ID
116 .\"O Each process has a session ID and a process group ID,
117 .\"O both represented using the type
119 .\"O A process can obtain its session ID using
121 .\"O and its process group ID using
122 .\"O .BR getpgrp (2).
123 各プロセスはセッション ID とプロセスグループ ID を持つ。
130 を使って自分のセッション ID、プロセスグループ ID を取得できる。
132 .\"O A child created by
134 .\"O inherits its parent's session ID and process group ID.
135 .\"O A process's session ID and process group ID are preserved across an
138 で生成された子プロセスは親プロセスのセッション ID とプロセスグループ ID
139 を継承する。プロセスのセッション ID とプロセスグループ ID は
143 .\"O Sessions and process groups are abstractions devised to support shell
145 .\"O A process group (sometimes called a "job") is a collection of
146 .\"O processes that share the same process group ID;
147 .\"O the shell creates a new process group for the process(es) used
148 .\"O to execute single command or pipeline (e.g., the two processes
149 .\"O created to execute the command "ls\ |\ wc" are placed in the
150 .\"O same process group).
151 .\"O A process's group membership can be set using
152 .\"O .BR setpgid (2).
153 .\"O The process whose process ID is the same as its process group ID is the
154 .\"O \fIprocess group leader\fP for that group.
155 セッションとプロセスグループの概念は、シェルのジョブ制御を行うために
157 プロセスグループ (時には「ジョブ」と呼ばれることもある) は、
158 同じプロセスグループ ID を共有するプロセスの集まりである。
159 シェルは、一つのコマンドもしくはパイプラインの実行に使われるプロセス群に
161 (例えば、コマンド "ls\ |\ wc" を実行するために生成される二つのプロセスは
166 自身のプロセス ID がプロセスグループ ID と同じプロセスは、
167 そのグループの「プロセスグループ・リーダー」である。
169 .\"O A session is a collection of processes that share the same session ID.
170 .\"O All of the members of a process group also have the same session ID
171 .\"O (i.e., all of the members of a process group always belong to the
172 .\"O same session, so that sessions and process groups form a strict
173 .\"O two-level hierarchy of processes.)
174 .\"O A new session is created when a process calls
176 .\"O which creates a new session whose session ID is the same
177 .\"O as the PID of the process that called
179 .\"O The creator of the session is called the \fIsession leader\fP.
180 セッションは、同じセッション ID を共有するプロセスの集まりである。
181 ある一つのプロセスグループの全メンバーは同じセッション ID を持つ
182 (つまり、一つのプロセスグループのメンバーは全て同じセッションに所属し、
183 これにより、セッションとプロセスグループで二階層のプロセス階層が形成できる)。
190 を呼び出したプロセスの PID と同じ値のセッション ID を持つ
192 セッションの生成者は「セッション・リーダー」と呼ばれる。
193 .\"O .SS User and Group Identifiers
195 .\"O Each process has various associated user and groups IDs.
196 .\"O These IDs are integers, respectively represented using the types
201 .\"O .IR <sys/types.h> ).
202 各プロセスは、数種類のユーザ ID とグループ ID を持つ。
203 ユーザ ID、グループ ID は整数で、それぞれ
210 .\"O On Linux, each process has the following user and group identifiers:
211 Linux では、各プロセスは以下のような種類のユーザ ID とグループ ID を持つ。
213 .\"O Real user ID and real group ID.
215 .\"O These IDs determine who owns the process.
216 .\"O A process can obtain its real user (group) ID using
218 .\"O .RB ( getgid (2)).
219 これらの ID によりプロセスの所有者が決定される。
220 プロセスが自分の実ユーザ ID、実グループ ID を取得するには、それぞれ
225 .\"O Effective user ID and effective group ID.
227 .\"O These IDs are used by the kernel to determine the permissions
228 .\"O that the process will have when accessing shared resources such
229 .\"O as message queues, shared memory, and semaphores.
230 .\"O On most UNIX systems, these IDs also determine the
231 .\"O permissions when accessing files.
232 .\"O However, Linux uses the file system IDs described below
234 .\"O A process can obtain its effective user (group) ID using
236 .\"O .RB ( getegid (2)).
237 これらの ID は、メッセージキュー、共有メモリ、セマフォなどの
238 共有リソースにアクセスしようとした際にそのプロセスがアクセス許可を
239 持っているかをカーネルが判定するのに使用される。
240 ほとんどの UNIX システムでは、これらの ID はファイルへのアクセス時の
242 しかしながら、Linux ではファイルへのアクセス許可の判定には
243 後述のファイルシステム ID が使用される。
244 プロセスが自分の実効ユーザ ID、実効グループ ID を取得するには、それぞれ
249 .\"O Saved set-user-ID and saved set-group-ID.
250 保存 (saved) set-user-ID と保存 set-group-ID。
251 .\"O These IDs are used in set-user-ID and set-group-ID programs to save
252 .\"O a copy of the corresponding effective IDs that were set when
253 .\"O the program was executed (see
254 .\"O .BR execve (2)).
255 これらの ID は、set-user-ID や set-group-ID されたプログラムにおいて、
256 プログラムの実行時に設定された実効 ID のコピーを保存するために
260 .\"O A set-user-ID program can assume and drop privileges by
261 .\"O switching its effective user ID back and forth between the values
262 .\"O in its real user ID and saved set-user-ID.
263 .\"O This switching is done via calls to
264 .\"O .BR seteuid (2),
265 .\"O .BR setreuid (2),
267 .\"O .BR setresuid (2).
268 .\"O A set-group-ID program performs the analogous tasks using
269 .\"O .BR setegid (2),
270 .\"O .BR setregid (2),
272 .\"O .BR setresgid (2).
273 set-user-ID プログラムは、実効ユーザ ID を実ユーザID と保存 set-user-ID
274 の間で行ったり来たり切り替えることで、特権を得たり落としたりできる。
285 .\"O A process can obtain its saved set-user-ID (set-group-ID) using
286 .\"O .BR getresuid (2)
287 .\"O .RB ( getresgid (2)).
288 プロセスが自分の保存 set-user-ID、保存 set-group-ID を取得するには、
293 .\"O File system user ID and file system group ID (Linux-specific).
294 ファイルシステム・ユーザ ID とファイルシステム・グループ ID (Linux 固有)。
295 .\"O These IDs, in conjunction with the supplementary group IDs described
296 .\"O below, are used to determine permissions for accessing files; see
297 .\"O .BR path_resolution (7)
299 .\"O Whenever a process's effective user (group) ID is changed,
300 .\"O the kernel also automatically changes the file system user (group) ID
301 .\"O to the same value.
302 .\"O Consequently, the file system IDs normally have the same values
303 .\"O as the corresponding effective ID, and the semantics for file-permission
304 .\"O checks are thus the same on Linux as on other UNIX systems.
305 .\"O The file system IDs can be made to differ from the effective IDs
307 .\"O .BR setfsuid (2)
309 .\"O .BR setfsgid (2).
310 これらの ID は、後述の補助グループ ID と組み合わせて使用され、
311 ファイルへのアクセス権の決定に利用される。詳細は
312 .BR path_resolution (7)
314 プロセスの実効 ID (ユーザ ID や グループ ID) が変更されるたびに、
315 カーネルは自動的に対応するファイルシステム ID を同じ値に変更する。
316 その結果、ファイルシステム ID は通常は対応する実効 ID と同じ値となり、
317 ファイルのアクセス権のチェック方法は Linux と他の UNIX システムで同じである。
318 ファイルシステム ID は実効 ID とは異なる値にすることができ、
325 .\"O Supplementary group IDs.
327 .\"O This is a set of additional group IDs that are used for permission
328 .\"O checks when accessing files and other shared resources.
329 .\"O On Linux kernels before 2.6.4,
330 .\"O a process can be a member of up to 32 supplementary groups;
331 .\"O since kernel 2.6.4,
332 .\"O a process can be a member of up to 65536 supplementary groups.
333 この ID は、ファイルや他の共有リソースへのアクセス時にアクセス許可の
334 チェックに使用される、追加のグループ ID の集合である。
335 カーネル 2.6.4 より前の Linux では、一つのプロセスあたりの
336 補助グループのメンバー数は最大で 32 である。
337 カーネル 2.6.4 以降では、一つのプロセスあたりの
338 補助グループのメンバー数は最大で 65536 である。
340 .\"O .I sysconf(_SC_NGROUPS_MAX)
341 .\"O can be used to determine the number of supplementary groups
342 .\"O of which a process may be a member.
343 .I sysconf(_SC_NGROUPS_MAX)
344 を呼び出すことで、あるプロセスがメンバーとなることができる可能性のある
346 .\" Since kernel 2.6.4, the limit is visible via the read-only file
347 .\" /proc/sys/kernel/ngroups_max.
348 .\" As at 2.6.22-rc2, this file is still read-only.
349 .\"O A process can obtain its set of supplementary group IDs using
350 .\"O .BR getgroups (2),
351 .\"O and can modify the set using
352 .\"O .BR setgroups (2).
353 プロセスは、自分の補助グループ ID の集合を
359 .\"O A child process created by
361 .\"O inherits copies of its parent's user and groups IDs.
364 .\"O a process's real user and group ID and supplementary
365 .\"O group IDs are preserved;
366 .\"O the effective and saved set IDs may be changed, as described in
369 で生成された子プロセスは親プロセスのユーザ ID とグループ ID を継承する。
371 の間、プロセスの実ユーザ/グループ ID と補助グループ ID 集合は不変である。
372 実効 ID と保存セット ID は変更される可能性がある
376 .\"O Aside from the purposes noted above,
377 .\"O a process's user IDs are also employed in a number of other contexts:
378 上記の目的以外にも、プロセスのユーザ ID は他の様々な場面で利用される。
380 .\"O when determining the permissions for sending signals\(emsee
386 .\"O when determining the permissions for setting
387 .\"O process-scheduling parameters (nice value, real time
388 .\"O scheduling policy and priority, CPU affinity, I/O priority) using
389 .\"O .BR setpriority (2),
390 .\"O .BR sched_setaffinity (2),
391 .\"O .BR sched_setscheduler (2),
392 .\"O .BR sched_setparam (2),
394 .\"O .BR ioprio_set (2);
395 プロセスのスケジューリング関連のパラメータ (nice 値、
396 リアルタイム・スケジューリングポリシーや優先度、CPU affinity、
400 .BR sched_setaffinity (2),
401 .BR sched_setscheduler (2),
402 .BR sched_setparam (2),
406 .\"O when checking resource limits; see
407 .\"O .BR getrlimit (2);
412 .\"O when checking the limit on the number of inotify instances
413 .\"O that the process may create; see
414 .\"O .BR inotify (7).
415 プロセスが生成できる inotify インスタンス数の上限のチェック時。
418 .\"O .SH "CONFORMING TO"
420 .\"O Process IDs, parent process IDs, process group IDs, and session IDs
421 .\"O are specified in POSIX.1-2001.
422 .\"O The real, effective, and saved set user and groups IDs,
423 .\"O and the supplementary group IDs, are specified in POSIX.1-2001.
424 .\"O The file system user and group IDs are a Linux extension.
425 プロセス ID、親プロセス ID、プロセスグループ ID、セッション ID は
426 POSIX.1-2001 で規定されている。
427 実 ID、実効 ID、保存セット ID のユーザ ID / グループ ID および
428 補助グループ ID は POSIX.1-2001 で規定されている。
429 ファイルシステム・ユーザ ID / グループ ID は Linux による拡張である。
432 .\"O The POSIX threads specification requires that
433 .\"O credentials are shared by all of the threads in a process.
434 .\"O However, at the kernel level, Linux maintains separate user and group
435 .\"O credentials for each thread.
436 .\"O The NPTL threading implementation does some work to ensure
437 .\"O that any change to user or group credentials
440 .\"O .BR setresuid (2),
442 .\"O is carried through to all of the POSIX threads in a process.
443 POSIX のスレッド仕様では、これらの識別子がプロセス内の全スレッドで
445 しかしながら、カーネルのレベルでは、Linux はスレッド毎に別々の
446 ユーザとグループに関する識別子を管理している。
450 などの呼び出しによる) ユーザやグループに関する識別子に対する変更が
451 プロセス内の全ての POSIX スレッドに対して反映されることを保証する
482 .BR capabilities (7),
483 .BR path_resolution (7),