OSDN Git Service

sudo: Drafts posted in [JM:00631] to [JM:00635].
[linuxjm/jm.git] / manual / sudo / draft / man8 / sudo.8
1 .\" Copyright (c) 1994-1996, 1998-2005, 2007-2012
2 .\"     Todd C. Miller <Todd.Miller@courtesan.com>
3 .\" 
4 .\" Permission to use, copy, modify, and distribute this software for any
5 .\" purpose with or without fee is hereby granted, provided that the above
6 .\" copyright notice and this permission notice appear in all copies.
7 .\" 
8 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 .\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 .\" 
17 .\" Sponsored in part by the Defense Advanced Research Projects
18 .\" Agency (DARPA) and Air Force Research Laboratory, Air Force
19 .\" Materiel Command, USAF, under agreement number F39502-99-1-0512.
20 .\" 
21 .\" Japanese Version Copyright (c) 2000-2002 Yuichi SATO
22 .\"   and 2009 Yoichi Chonan
23 .\"         all rights reserved.
24 .\" Translated Sat Oct  7 14:39:18 JST 2000
25 .\"         by Yuichi SATO <ysato444@yahoo.co.jp>
26 .\" Updated & Modified Fri Dec  6 04:40:44 JST 2002 by Yuichi SATO
27 .\" New Translation (sudo-1.6.9p17) Fri Jan 23 10:31:17 JST 2009
28 .\"         by Yoichi Chonan <cyoichi@maple.ocn.ne.jp>
29 .\" Updated & Modified (sudo-1.7.2p1) Sat Nov 14 21:15:16 JST 2009
30 .\"         by Yoichi Chonan
31 .\" Updated & Modified (sudo-1.8.4p4) Sun Apr  1 15:31:07 JST 2012
32 .\"         by Yoichi Chonan
33 .\"
34 .nr SL 0
35 .nr BA 0
36 .nr LC 0
37 .nr PT 5
38 .\"
39 .\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14)
40 .\"
41 .\" Standard preamble:
42 .\" ========================================================================
43 .de Sp \" Vertical space (when we can't use .PP)
44 .if t .sp .5v
45 .if n .sp
46 ..
47 .de Vb \" Begin verbatim text
48 .ft CW
49 .nf
50 .ne \\$1
51 ..
52 .de Ve \" End verbatim text
53 .ft R
54 .fi
55 ..
56 .\" Set up some character translations and predefined strings.  \*(-- will
57 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
58 .\" double quote, and \*(R" will give a right double quote.  \*(C+ will
59 .\" give a nicer C++.  Capital omega is used to do unbreakable dashes and
60 .\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
61 .\" nothing in troff, for use with C<>.
62 .tr \(*W-
63 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
64 .ie n \{\
65 .    ds -- \(*W-
66 .    ds PI pi
67 .    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
68 .    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
69 .    ds L" ""
70 .    ds R" ""
71 .    ds C` 
72 .    ds C' 
73 'br\}
74 .el\{\
75 .    ds -- \|\(em\|
76 .    ds PI \(*p
77 .    ds L" ``
78 .    ds R" ''
79 'br\}
80 .\"
81 .\" Escape single quotes in literal strings from groff's Unicode transform.
82 .ie \n(.g .ds Aq \(aq
83 .el       .ds Aq '
84 .\"
85 .\" If the F register is turned on, we'll generate index entries on stderr for
86 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
87 .\" entries marked with X<> in POD.  Of course, you'll have to process the
88 .\" output yourself in some meaningful fashion.
89 .ie \nF \{\
90 .    de IX
91 .    tm Index:\\$1\t\\n%\t"\\$2"
92 ..
93 .    nr % 0
94 .    rr F
95 .\}
96 .el \{\
97 .    de IX
98 ..
99 .\}
100 .\"
101 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
102 .\" Fear.  Run.  Save yourself.  No user-serviceable parts.
103 .    \" fudge factors for nroff and troff
104 .if n \{\
105 .    ds #H 0
106 .    ds #V .8m
107 .    ds #F .3m
108 .    ds #[ \f1
109 .    ds #] \fP
110 .\}
111 .if t \{\
112 .    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
113 .    ds #V .6m
114 .    ds #F 0
115 .    ds #[ \&
116 .    ds #] \&
117 .\}
118 .    \" simple accents for nroff and troff
119 .if n \{\
120 .    ds ' \&
121 .    ds ` \&
122 .    ds ^ \&
123 .    ds , \&
124 .    ds ~ ~
125 .    ds /
126 .\}
127 .if t \{\
128 .    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
129 .    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
130 .    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
131 .    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
132 .    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
133 .    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
134 .\}
135 .    \" troff and (daisy-wheel) nroff accents
136 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
137 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
138 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
139 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
140 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
141 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
142 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
143 .ds ae a\h'-(\w'a'u*4/10)'e
144 .ds Ae A\h'-(\w'A'u*4/10)'E
145 .    \" corrections for vroff
146 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
147 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
148 .    \" for low resolution devices (crt and lpr)
149 .if \n(.H>23 .if \n(.V>19 \
150 \{\
151 .    ds : e
152 .    ds 8 ss
153 .    ds o a
154 .    ds d- d\h'-1'\(ga
155 .    ds D- D\h'-1'\(hy
156 .    ds th \o'bp'
157 .    ds Th \o'LP'
158 .    ds ae ae
159 .    ds Ae AE
160 .\}
161 .rm #[ #] #H #V #F C
162 .\" ========================================================================
163 .\"
164 .IX Title "SUDO 8"
165 .TH SUDO 8 "February  5, 2012" "1.8.4" "MAINTENANCE COMMANDS"
166 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
167 .\" way too many mistakes in technical documents.
168 .if n .ad l
169 .nh
170 .\"O .SH "NAME"
171 .SH "名前"
172 .\"O sudo, sudoedit \- execute a command as another user
173 sudo, sudoedit \- コマンドを他のユーザとして実行する
174 .\"O .SH "SYNOPSIS"
175 .SH "書式"
176 .IX Header "SYNOPSIS"
177 \&\fBsudo\fR \fB\-h\fR | \fB\-K\fR | \fB\-k\fR | \fB\-V\fR
178 .PP
179 \&\fBsudo\fR \fB\-v\fR [\fB\-AknS\fR]
180 .if \n(BA [\fB\-a\fR\ \fIauth_type\fR]
181 [\fB\-g\fR\ \fIgroup\ name\fR|\fI#gid\fR] [\fB\-p\fR\ \fIprompt\fR]
182 [\fB\-u\fR\ \fIuser\ name\fR|\fI#uid\fR]
183 .PP
184 \&\fBsudo\fR \fB\-l[l]\fR [\fB\-AknS\fR]
185 .if \n(BA [\fB\-a\fR\ \fIauth_type\fR]
186 [\fB\-g\fR\ \fIgroup\ name\fR|\fI#gid\fR] [\fB\-p\fR\ \fIprompt\fR]
187 [\fB\-U\fR\ \fIuser\ name\fR] [\fB\-u\fR\ \fIuser\ name\fR|\fI#uid\fR] [\fIcommand\fR]
188 .PP
189 \&\fBsudo\fR [\fB\-AbEHnPS\fR]
190 .if \n(BA [\fB\-a\fR\ \fIauth_type\fR]
191 [\fB\-C\fR\ \fIfd\fR]
192 .if \n(LC [\fB\-c\fR\ \fIclass\fR|\fI\-\fR]
193 [\fB\-g\fR\ \fIgroup\ name\fR|\fI#gid\fR] [\fB\-p\fR\ \fIprompt\fR]
194 .if \n(SL [\fB\-r\fR\ \fIrole\fR] [\fB\-t\fR\ \fItype\fR]
195 [\fB\-u\fR\ \fIuser\ name\fR|\fI#uid\fR]
196 [\fB\s-1VAR\s0\fR=\fIvalue\fR] [\fB\-i\fR\ |\ \fB\-s\fR] [\fIcommand\fR]
197 .PP
198 \&\fBsudoedit\fR [\fB\-AnS\fR]
199 .if \n(BA [\fB\-a\fR\ \fIauth_type\fR]
200 [\fB\-C\fR\ \fIfd\fR]
201 .if \n(LC [\fB\-c\fR\ \fIclass\fR|\fI\-\fR]
202 [\fB\-g\fR\ \fIgroup\ name\fR|\fI#gid\fR] [\fB\-p\fR\ \fIprompt\fR]
203 [\fB\-u\fR\ \fIuser\ name\fR|\fI#uid\fR] file ...
204 .\"O .SH "DESCRIPTION"
205 .SH "説明"
206 .IX Header "DESCRIPTION"
207 .\"O \&\fBsudo\fR allows a permitted user to execute a \fIcommand\fR as the
208 .\"O superuser or another user, as specified by the security policy.
209 .\"O The real and effective uid and gid are set to match those of the
210 .\"O target user, as specified in the password database, and the group
211 .\"O vector is initialized based on the group database (unless the \fB\-P\fR
212 .\"O option was specified).
213 .\"O .PP
214 \&\fBsudo\fR を使用すると、許可されたユーザーが、
215 スーパーユーザや他のユーザに変身して、コマンドを実行することが可能になる。
216 許可の範囲については、セキュリティ・ポリシーの指定するところに従う。
217 実 uid と gid、実効 uid と gid は、変身の対象になるユーザの、
218 パスワード・データベースに記載されているものと同一になるようにセットされる。
219 所属するグループについても (\fB\-P\fR オプションが指定されていないかぎり)、
220 グループ・データベースに基づいて初期化される。
221 .PP
222 .\"O \&\fBsudo\fR supports a plugin architecture for security policies and
223 .\"O input/output logging.  Third parties can develop and distribute
224 .\"O their own policy and I/O logging modules to work seamlessly with
225 .\"O the \fBsudo\fR front end.  The default security policy is \fIsudoers\fR,
226 .\"O which is configured via the file \fI/etc/sudoers\fR, or via
227 .\"O \&\s-1LDAP\s0.  See the \s-1PLUGINS\s0 section for more information.
228 .\"O .PP
229 \&\fBsudo\fR はセキュリティ・ポリシーと入出力のロギングについて、
230 プラグイン方式をサポートしている。このため、\fBsudo\fR
231 フロントエンドとシームレスに共動するポリシー・モジュールや
232 I/O ロギング・モジュールを、サードパーティが独自に開発して配布することが可能である。
233 デフォルトのセキュリティ・ポリシーは \fIsudoers\fR であり、その設定は、
234 \&\fI/etc/sudoers\fR ファイル、もしくは \s-1LDAP\s0 を通して行われる。
235 詳細については、「プラグイン」セクションを参照してほしい。
236 .PP
237 .\"O The security policy determines what privileges, if any, a user has
238 .\"O to run \fBsudo\fR.  The policy may require that users authenticate
239 .\"O themselves with a password or another authentication mechanism.  If
240 .\"O authentication is required, \fBsudo\fR will exit if the user's password
241 .\"O is not entered within a configurable time limit.  This limit is
242 .\"O policy-specific; the default password prompt timeout for the
243 .\"O \&\fIsudoers\fR security policy is 
244 .\"O .ie \n(PT \f(CW\*(C`5\*(C'\fR minutes.
245 .\"O .el unlimited.
246 .\"O .PP
247 セキュリティ・ポリシーによって、あるユーザに \fBsudo\fR
248 を使用する権限があるかどうか、
249 あるとすれば、どんな権限を持っているかが決定される。
250 このポリシーは、ユーザにパスワードや他の認証方法を使って、
251 本人であることを証明するように要求してもよい。認証が必要な場合、
252 ユーザがパスワードを (設定によって変更可能な) 制限時間内に入力しないと、
253 \&\fBsudo\fR は時間切れで終了する。この制限時間はポリシー次第であり、
254 \&\fIsudoers\fR セキュリティ・ポリシーの場合、
255 パスワード・プロンプトがタイムアウトするまでのデフォルトの時間は、
256 .ie \n(PT \f(CW\*(C`5\*(C'\fR 分間である.
257 .el 無制限である.
258 .PP
259 .\"O Security policies may support credential caching to allow the user
260 .\"O to run \fBsudo\fR again for a period of time without requiring
261 .\"O authentication.  The \fIsudoers\fR policy caches credentials for
262 .\"O \&\f(CW\*(C`5\*(C'\fR minutes, unless overridden in \fIsudoers\fR\|(5).  By
263 .\"O running \fBsudo\fR with the \fB\-v\fR option, a user can update the cached
264 .\"O credentials without running a \fIcommand\fR.
265 .\"O .PP
266 セキュリティ・ポリシーは、一定時間内ならユーザが認証なしで \fBsudo\fR
267 を何度も実行できるように、認証情報の一時保存 (credential caching)
268 をサポートしてもよい。\fIsudoers\fR ポリシーでは、\fIsudoers\fR\|(5)
269 で変更されないかぎり、認証情報を \f(CW\*(C`5\*(C'\fR 分間保持する。
270 ユーザは \fBsudo\fR に \fB\-v\fR を付けて実行することで、
271 \&\fIcommand\fR を実行しないでも、保存された認証情報を更新することができる。
272 .PP
273 .\"O When invoked as \fBsudoedit\fR, the \fB\-e\fR option (described below),
274 .\"O is implied.
275 .\"O .PP
276 \&\fBsudoedit\fR というコマンド名で起動するのは、\fBsudo\fR に \fB-e\fR 
277 オプション (下記参照) を付けて実行するのと同じである。
278 .PP
279 .\"O Security policies may log successful and failed attempts to use
280 .\"O \&\fBsudo\fR.  If an I/O plugin is configured, the running command's
281 .\"O input and output may be logged as well.
282 セキュリティ・ポリシーは、ユーザが \fBsudo\fR を使おうとして
283 成功した場合も失敗した場合も、それをログに記録することができる。
284 I/O プラグインが設定によって組み込まれている場合は、
285 実行しているコマンドの入出力もログに残すことができる。
286 .\"O .SH "OPTIONS"
287 .SH "オプション"
288 .IX Header "OPTIONS"
289 .\"O \&\fBsudo\fR accepts the following command line options:
290 \&\fBsudo\fR では以下のコマンドライン・オプションが使用できる。
291 .IP "\-A" 12
292 .IX Item "-A"
293 .\"O Normally, if \fBsudo\fR requires a password, it will read it from the
294 .\"O user's terminal.  If the \fB\-A\fR (\fIaskpass\fR) option is specified,
295 .\"O a (possibly graphical) helper program is executed to read the user's
296 .\"O password and output the password to the standard output.  If the
297 .\"O \&\f(CW\*(C`SUDO_ASKPASS\*(C'\fR environment variable is set, it specifies the path
298 .\"O to the helper program.  Otherwise, if \fI/etc/sudo.conf\fR
299 .\"O contains a line specifying the askpass program, that value will be
300 .\"O used.  For example:
301 通常 \fBsudo\fR がパスワードを要求するとき、
302 パスワードはユーザが使用している端末から読み込まれる。
303 \&\fB\-A\fR (\fIaskpass\fR) オプションを指定した場合は、
304 ヘルパー・プログラム (グラフィカルなものでもよい)
305 が実行されて、ユーザのパスワードを読み込み、それを標準出力に書き出す。
306 環境変数 \f(CW\*(C`SUDO_ASKPASS\*(C'\fR が設定されているときは、
307 それがヘルパー・プログラムのパスになる。それ以外の場合、
308 \fI/etc/sudo.conf\fR に askpass プログラムを指定している行が存在すれば、
309 その値が使用される。一例を挙げる。
310 .Sp
311 .Vb 2
312 .\"O \&    # Path to askpass helper program
313 \&    # askpass ヘルパー・プログラムのパス
314 \&    Path askpass /usr/X11R6/bin/ssh\-askpass
315 .Ve
316 .Sp
317 .\"O If no askpass program is available, sudo will exit with an error.
318 利用できる askpass プログラムがないと、\fBsudo\fR
319 はエラーメッセージを出して、終了する。
320 .if \n(BA \{\
321 .IP "\-a \fItype\fR" 12
322 .IX Item "-a type"
323 .\"O The \fB\-a\fR (\fIauthentication type\fR) option causes \fBsudo\fR to use the
324 .\"O specified authentication type when validating the user, as allowed
325 .\"O by \fI/etc/login.conf\fR.  The system administrator may specify a list
326 .\"O of sudo-specific authentication methods by adding an \*(L"auth-sudo\*(R"
327 .\"O entry in \fI/etc/login.conf\fR.  This option is only available on systems
328 .\"O that support \s-1BSD\s0 authentication.
329 \&\fB\-a\fR (\fIauthentication type\fR) オプションを使うと、
330 \&\fBsudo\fR はユーザの認証に、指定したタイプの認証方法を使用するようになる。
331 ただし、その認証のタイプは \fI/etc/login.conf\fR
332 で有効になっていなければならない。システム管理者は \fI/etc/login.conf\fR に
333 \&\*(L"auth-sudo\*(R" 項目を追加することによって、
334 \&\fBsudo\fR 専用の認証方法のリストを指定することができる。
335 このオプションは \s-1BSD\s0 認証に対応したシステムでのみ有効である。
336 \}
337 .IP "\-b" 12
338 .IX Item "-b"
339 .\"O The \fB\-b\fR (\fIbackground\fR) option tells \fBsudo\fR to run the given
340 .\"O command in the background.  Note that if you use the \fB\-b\fR
341 .\"O option you cannot use shell job control to manipulate the process.
342 .\"O Most interactive commands will fail to work properly in background
343 .\"O mode.
344 \&\fB\-b\fR (\fIbackground\fR) オプションを付けると、\fBsudo\fR
345 は指定されたコマンドをバックグラウンドで実行する。
346 \&\fB-b\fR オプションを使用すると、
347 シェルのジョブ制御を使ってプロセスを操作できなくなるので、注意してほしい。
348 バックグラウンドモードでは、対話的なコマンドのほとんどがまともに動かないだろう。
349 .IP "\-C \fIfd\fR" 12
350 .IX Item "-C fd"
351 .\"O Normally, \fBsudo\fR will close all open file descriptors other than
352 .\"O standard input, standard output and standard error.  The \fB\-C\fR
353 .\"O (\fIclose from\fR) option allows the user to specify a starting point
354 .\"O above the standard error (file descriptor three).  Values less than
355 .\"O three are not permitted.  The security policy may restrict the
356 .\"O user's ability to use the \fB\-C\fR option.  The \fIsudoers\fR policy only
357 .\"O permits use of the \fB\-C\fR option when the administrator has enabled
358 .\"O the \fIclosefrom_override\fR option.
359 通常、\fBsudo\fR は、(コマンドを実行する前に) 標準入力、標準出力、
360 標準エラーを除いて、
361 開いているファイル・ディスクリプタをすべて閉じることになっている。
362 \&\fB\-C\fR (\fIclose from\fR) オプションを使えば、
363 標準エラーより番号が大きい (すなわち、ファイル・ディスクリプタ 3 以上の)
364 どのファイル・ディスクリプタから閉じていくかを、ユーザが指定することができる。
365 3 未満の値は指定できない。セキュリティ・ポリシーによっては、ユーザの
366 \&\fB\-C\fR オプション使用を制限していることがある。
367 \&\fIsudoers\fR ポリシーが \fB\-C\fR オプションの使用を許可しているのは、
368 管理者が \fIclosefrom_override\fR オプションを有効にしているときのみである。
369 .if \n(LC \{\
370 .IP "\-c \fIclass\fR" 12
371 .IX Item "-c class"
372 .\"O The \fB\-c\fR (\fIclass\fR) option causes \fBsudo\fR to run the specified command
373 .\"O with resources limited by the specified login class.  The \fIclass\fR
374 .\"O argument can be either a class name as defined in \fI/etc/login.conf\fR,
375 .\"O or a single '\-' character.  Specifying a \fIclass\fR of \f(CW\*(C`\-\*(C'\fR indicates
376 .\"O that the command should be run restricted by the default login
377 .\"O capabilities for the user the command is run as.  If the \fIclass\fR
378 .\"O argument specifies an existing user class, the command must be run
379 .\"O as root, or the \fBsudo\fR command must be run from a shell that is already
380 .\"O root.  This option is only available on systems with \s-1BSD\s0 login classes.
381 \&\fB\-c\fR (\fIclass\fR) オプションを付けると、その指定した
382 login class のリソースの制限内で、\fBsudo\fR は指定されたコマンドを実行する。
383 \&\fB-c\fR の引き数 \fIclass\fR に使うことができるのは、
384 \&\fI/etc/login.conf\fR で定義された class 名か、一個の '\-' 文字である。
385 \&\fIclass\fR に \f(CW\*(C`\-\*(C'\fR を指定すると、コマンドは実行されるとき、
386 変身対象ユーザのデフォルトのログイン権限によって制限されることになる。
387 引き数 \fIclass\fR が実在する user class を指している場合は、コマンドを
388 root として実行するか、あるいはすでに root になったシェルで
389 \&\fBsudo\fR コマンドを実行するかしなければならない。 
390 このオプションは、\s-1BSD\s0 login class が存在するシステムでのみ有効である。
391 \}
392 .IP "\-E" 12
393 .IX Item "-E"
394 .\"O The \fB\-E\fR (\fIpreserve\fR \fIenvironment\fR) option indicates to the
395 .\"O security policy that the user wishes to preserve their existing
396 .\"O environment variables.  The security policy may return an error if
397 .\"O the \fB\-E\fR option is specified and the user does not have permission
398 .\"O to preserve the environment.
399 \&\fB\-E\fR (\fIpreserve\fR \fIenvironment\fR) オプションを指定すると、
400 現在の環境変数をそのまま保持するのがユーザの意向だと、
401 セキュリティ・ポリシーに伝えることになる。\fB\-E\fR が指定されても、
402 ユーザが環境を保持する許可を持っていない場合は、
403 セキュリティ・ポリシーがエラーを返すだろう。
404 .IP "\-e" 12
405 .IX Item "-e"
406 .\"O The \fB\-e\fR (\fIedit\fR) option indicates that, instead of running a
407 .\"O command, the user wishes to edit one or more files.  In lieu of a
408 .\"O command, the string \*(L"sudoedit\*(R" is used when consulting the security
409 .\"O policy.  If the user is authorized by the policy, the following
410 .\"O steps are taken:
411 \&\fB\-e\fR (\fIedit\fR) オプションを指定するのは、
412 ユーザがコマンドの実行ではなく、
413 一個以上のファイルを編集しようとしていることを意味する。
414 セキュリティ・ポリシーの参照では、
415 コマンド名として文字列 \*(L"sudoedit\*(R" が使用される。
416 セキュリティ・ポリシーによってユーザに権限があることが認められると、
417 次のようなことが順番に行われる。
418 .RS 12
419 .IP "1." 4
420 .\"O Temporary copies are made of the files to be edited with the owner
421 .\"O set to the invoking user.
422 編集対象のファイルのコピーをテンポラリファイルとして作成する。
423 テンポラリファイルのオーナーは \fBsudo\fR を起動したユーザである。
424 .IP "2." 4
425 .\"O The editor specified by the policy is run to edit the temporary files.
426 .\"O The \fIsudoers\fR policy uses the \f(CW\*(C`SUDO_EDITOR\*(C'\fR, \f(CW\*(C`VISUAL\*(C'\fR and \f(CW\*(C`EDITOR\*(C'\fR
427 .\"O environment variables (in that order).  If none of \f(CW\*(C`SUDO_EDITOR\*(C'\fR,
428 .\"O \&\f(CW\*(C`VISUAL\*(C'\fR or \f(CW\*(C`EDITOR\*(C'\fR are set, the first program listed in the
429 .\"O \&\fIeditor\fR \fIsudoers\fR\|(5) option is used.
430 セキュリティ・ポリシーによって指定されたエディタを起動して、
431 テンポラリファイルを編集する。\fIsudoers\fR ポリシーでは、環境変数の
432 \&\f(CW\*(C`SUDO_EDITOR\*(C'\fR, \f(CW\*(C`VISUAL\*(C'\fR,
433 \&\f(CW\*(C`EDITOR\*(C'\fR を (この順番で) 使用する。
434 \&\f(CW\*(C`SUDO_EDITOR\*(C'\fR, \f(CW\*(C`VISUAL\*(C'\fR, 
435 \&\f(CW\*(C`EDITOR\*(C'\fR のどれも設定されていない場合は、\fIsudoers\fR\|(5)
436 の \fIeditor\fR オプションにリストされたプログラムのうち、
437 最初のものが使われる。
438 .IP "3." 4
439 .\"O If they have been modified, the temporary files are copied back to
440 .\"O their original location and the temporary versions are removed.
441 編集作業がすむと、テンポラリファイルをオリジナルのファイルに書き戻して、
442 テンポラリファイルを消去する。
443 .RE
444 .RS 12
445 .Sp
446 .\"O If the specified file does not exist, it will be created.  Note
447 .\"O that unlike most commands run by \fBsudo\fR, the editor is run with
448 .\"O the invoking user's environment unmodified.  If, for some reason,
449 .\"O \&\fBsudo\fR is unable to update a file with its edited version, the
450 .\"O user will receive a warning and the edited copy will remain in a
451 .\"O temporary file.
452 指定されたファイルが存在しない場合は作成する。ここで注意すべきは、
453 \&\fBsudo\fR によって実行されるコマンドの大部分と違って、
454 \&\fB\-e\fR でエディタが実行されるときは、\fBsudo\fR
455 を起動したユーザの環境が、変更を受けずにそのまま使われるということだ。
456 何らかの理由で \fBsudo\fR が編集した内容でファイルを更新できないときは、
457 ユーザに警告を発し、編集した内容をテンポラリファイルに保存することになる。
458 .RE
459 .IP "\-g \fIgroup\fR" 12
460 .IX Item "-g group"
461 .\"O Normally, \fBsudo\fR runs a command with the primary group set to the
462 .\"O one specified by the password database for the user the command is
463 .\"O being run as (by default, root).  The \fB\-g\fR (\fIgroup\fR) option causes
464 .\"O \&\fBsudo\fR to run the command with the primary group set to \fIgroup\fR
465 .\"O instead.  To specify a \fIgid\fR instead of a \fIgroup name\fR, use
466 .\"O \&\fI#gid\fR.  When running commands as a \fIgid\fR, many shells require
467 .\"O that the '#' be escaped with a backslash ('\e').  If no \fB\-u\fR option
468 .\"O is specified, the command will be run as the invoking user (not
469 .\"O root).  In either case, the primary group will be set to \fIgroup\fR.
470 通常 \fBsudo\fR はコマンドを実行するとき、プライマリ・グループを、
471 パスワード・データベースで変身対象ユーザ (デフォルトでは root である)
472 のプライマリ・グループとして指定されているグループに設定する。これに対して、
473 \&\fB\-g\fR (\fIgroup\fR) オプションを使用すると、
474 \&\fBsudo\fR はプライマリ・グループを \fIgroup\fR に設定して、
475 コマンドを実行することになる。グループ名の代わりに \fIgid\fR を指定するときは、
476 \&\fI#gid\fR という書き方をする。\fIgid\fR としてコマンドを実行する場合、
477 多くのシェルでは '#' をバックスラッシュ ('\e')
478 でエスケープしなければならない。
479 なお、\fB\-u\fR オプションが同時に指定されていない場合、コマンドは
480 (root としてではなく) \fBsudo\fR を起動したユーザの資格で実行される。
481 いづれにしろ、プライマリ・グループが \fIgroup\fR
482 に設定されることに変わりはない。
483 (訳注: \fB\-g\fR オプションを使用するには、
484 \&\fIsudoers\fR ポリシーの場合なら、\fIsudoers\fR ファイルのユーザ設定で、
485 変身対象となるグループを設定しておく必要がある。詳細については、
486 \&\fIsudoers\fR\|(5) のマニュアルの該当個所を参照してほしい。)
487 .IP "\-H" 12
488 .IX Item "-H"
489 .\"O The \fB\-H\fR (\fI\s-1HOME\s0\fR) option requests that the security policy set
490 .\"O the \f(CW\*(C`HOME\*(C'\fR environment variable to the home directory of the target
491 .\"O user (root by default) as specified by the password database.
492 .\"O Depending on the policy, this may be the default behavior.
493 \&\fB\-H\fR (\fI\s-1HOME\s0\fR) オプションを指定するのは、環境変数
494 \&\f(CW\*(C`HOME\*(C'\fR を、パスワード・データベースで変身対象ユーザ
495 (デフォルトでは root) のホームディレクトリに指定されているディレクトリに設定するよう、
496 セキュリティ・ポリシーに要求することである。
497 ポリシーによっては、それがデフォルトの動作になっているかもしれない。
498 .IP "\-h" 12
499 .IX Item "-h"
500 .\"O The \fB\-h\fR (\fIhelp\fR) option causes \fBsudo\fR to print a short help message
501 .\"O to the standard output and exit.
502 \&\fB-h\fR (\fIhelp\fR) オプションを指定すると、
503 \&\fBsudo\fR は簡単なヘルプメッセージを標準出力に表示して、終了する。
504 .IP "\-i [command]" 12
505 .IX Item "-i [command]"
506 .\"O The \fB\-i\fR (\fIsimulate initial login\fR) option runs the shell specified
507 .\"O by the password database entry of the target user as a login shell.
508 .\"O This means that login-specific resource files such as \f(CW\*(C`.profile\*(C'\fR
509 .\"O or \f(CW\*(C`.login\*(C'\fR will be read by the shell.  If a command is specified,
510 .\"O it is passed to the shell for execution via the shell's \fB\-c\fR option.
511 .\"O If no command is specified, an interactive shell is executed.
512 .\"O \&\fBsudo\fR attempts to change to that user's home directory before
513 .\"O running the shell.  The security policy shall initialize the
514 .\"O environment to a minimal set of variables, similar to what is present
515 .\"O when a user logs in.  The \fICommand Environment\fR section in the
516 .\"O \&\fIsudoers\fR\|(5) manual documents how the \fB\-i\fR option affects the
517 .\"O environment in which a command is run when the \fIsudoers\fR policy
518 .\"O is in use.
519 \&\fB\-i\fR (\fIsimulate initial login\fR) オプションを指定すると、
520 パスワード・データベースの変身対象ユーザのエントリで指定されてているシェルが、
521 ログイン・シェルとして実行される。すなわち、\f(CW\*(C`.profile\*(C'\fR や
522 \&\f(CW\*(C`.login\*(C'\fR といった、ログイン用のリソースファイルが、
523 シェルによって読み込まれるわけだ。コマンドを指定すると、
524 それがシェルに渡され、シェルの  \fB\-c\fR オプションを使って実行される。
525 コマンドを指定しない場合は、対話的シェルが起動されることになる。\fBsudo\fR は、
526 シェルを実行する前に、変身対象ユーザのホームディレクトリに移動しようとする。
527 セキュリティ・ポリシーは、環境変数が最小限になるように、
528 すなわち、ユーザが普通にログインしたときの環境と同様になるように、
529 環境を初期化すべきである。
530 \&\fIsudoers\fR ポリシーを使用している場合に、
531 \&\fB\-i\fR オプションがコマンドの実行環境にどんな影響を与えるかについては、
532 \&\fIsudoers\fR\|(5) のマニュアルの「コマンド環境」セクションに説明がある。
533 .IP "\-K" 12
534 .IX Item "-K"
535 .\"O The \fB\-K\fR (sure \fIkill\fR) option is like \fB\-k\fR except that it removes
536 .\"O the user's cached credentials entirely and may not be used in
537 .\"O conjunction with a command or other option.  This option does not
538 .\"O require a password.  Not all security policies support credential
539 .\"O caching.
540 \&\fB\-K\fR (sure \fIkill\fR) オプションは \fB\-k\fR オプションに似ているが、
541 ユーザの保存された認証情報を完全に消去してしまう点と、
542 コマンドや他のオプションと組み合わせて使用できない点で異なっている。
543 このオプションはパスワードを要求しない。
544 すべてのセキュリティ・ポリシーが
545 認証情報の一時保存をサポートしているわけではない。
546 .IP "\-k [command]" 12
547 .IX Item "-k [command]"
548 .\"O When used alone, the \fB\-k\fR (\fIkill\fR) option to \fBsudo\fR invalidates
549 .\"O the user's cached credentials.  The next time \fBsudo\fR is run a
550 .\"O password will be required.  This option does not require a password
551 .\"O and was added to allow a user to revoke \fBsudo\fR permissions from a
552 .\"O \&.logout file.  Not all security policies support credential
553 .\"O caching.
554 \&\fB\-k\fR (\fIkill\fR) オプションを単独で使うと、
555 \&\fBsudo\fR はユーザの保存された認証情報を無効にする。
556 次回 \fBsudo\fR を実行するとき、パスワードが要求されることになるわけだ。
557 このオプション自体はパスワードを必要としない。
558 なお、このオプションが追加されたのは、ユーザが .logout ファイルで、\fBsudo\fR
559 をパスワードなしで実行できる期間を終了させることができるようにするためである。
560 すべてのセキュリティ・ポリシーが認証情報の一時保存をサポートしているわけではない。
561 .Sp
562 .\"O When used in conjunction with a command or an option that may require
563 .\"O a password, the \fB\-k\fR option will cause \fBsudo\fR to ignore the user's
564 .\"O cached credentials.  As a result, \fBsudo\fR will prompt for a password
565 .\"O (if one is required by the security policy) and will not update the
566 .\"O user's cached credentials.
567 \&\fB\-k\fR オプションをコマンドや、
568 パスワードを必要とするような他のオプションと組み合わせて使用すると、
569 \&\fBsudo\fR はユーザの保存された認証情報を無視することになる。
570 その結果、\fBsudo\fR は
571 (セキュリティ・ポリシーでパスワードを要求するようになっているならば)
572 プロンプトを出してパスワードを要求する。このとき、
573 ユーザの保存された認証情報の更新は行わない。
574 .IP "\-l[l] [\fIcommand\fR]" 12
575 .IX Item "-l[l] [command]"
576 .\"O If no \fIcommand\fR is specified, the \fB\-l\fR (\fIlist\fR) option will list
577 .\"O the allowed (and forbidden) commands for the invoking user (or the
578 .\"O user specified by the \fB\-U\fR option) on the current host.  If a
579 .\"O \&\fIcommand\fR is specified and is permitted by the security policy,
580 .\"O the fully-qualified path to the command is displayed along with any
581 .\"O command line arguments.  If \fIcommand\fR is specified but not allowed,
582 .\"O \&\fBsudo\fR will exit with a status value of 1.  If the \fB\-l\fR option
583 .\"O is specified with an \fBl\fR argument (i.e. \fB\-ll\fR), or if \fB\-l\fR is
584 .\"O specified multiple times, a longer list format is used.
585 \&\fIcommand\fR を指定しない場合、\fB\-l\fR (\fIlist\fR) オプションは、
586 \&\fBsudo\fR を実行しているユーザ (あるいは、\fB\-U\fR で指定したユーザ) が、
587 現在ログインしているホストで許可されている (及び、禁じられている)
588 コマンドを列挙する。\fIcommand\fR を指定した場合は、
589 セキュリティ・ポリシーで許可されているコマンドならば、その絶対パスを表示する。
590 このとき \fIcommand\fR に引数を付けると、それも一緒に表示される
591 (訳注: セキュリティ・ポリシーで許可するコマンドに引数まで指定している場合は、
592 それにマッチする引数を \fB\-l\fR に続く \fIcommand\fR にも必ず付けなければならない)。
593 指定したコマンドが許可されていない場合は、
594 \&\fBsudo\fR がステータス 1 で終了する。\fB\-l\fR オプションに
595 \&\fBl\fR という引数を付けた場合や (すなわち \fB\-ll\fR)、
596 \&\fB\-l\fR を複数回指定した場合は、長い方のリスト形式が使用される。
597 .IP "\-n" 12
598 .IX Item "-n"
599 .\"O The \fB\-n\fR (\fInon-interactive\fR) option prevents \fBsudo\fR from prompting
600 .\"O the user for a password.  If a password is required for the command
601 .\"O to run, \fBsudo\fR will display an error messages and exit.
602 \&\fB\-n\fR (\fInon-interactive\fR) オプションがあると、
603 \&\fBsudo\fR は ユーザにパスワードを要求するプロンプトを出さない。
604 実行するコマンドにパスワードが必要な場合、
605 \&\fBsudo\fR はエラーメッセージを表示して、終了する。
606 .IP "\-P" 12
607 .IX Item "-P"
608 .\"O The \fB\-P\fR (\fIpreserve\fR \fIgroup vector\fR) option causes \fBsudo\fR to
609 .\"O preserve the invoking user's group vector unaltered.  By default,
610 .\"O the \fIsudoers\fR policy will initialize the group vector to the list
611 .\"O of groups the target user is in.  The real and effective group IDs,
612 .\"O however, are still set to match the target user.
613 \&\fB\-P\fR (\fIpreserve\fR \fIgroup vector\fR) オプションを指定すると、
614 \&\fBsudo\fR は、\fBsudo\fR を実行するユーザが所属するグループのリストを、
615 変更せずにそのまま使用する。\fIsudoers\fR ポリシーの場合、デフォルトでは、
616 所属グループの初期値として、
617 変身対象となるユーザが所属するグループのリストを設定するのである。とは言え、
618 実 gid や 実効 gid が変身対象ユーザと同一になるようにセットされる点には、
619 変わりがない。
620 .IP "\-p \fIprompt\fR" 12
621 .IX Item "-p prompt"
622 .\"O The \fB\-p\fR (\fIprompt\fR) option allows you to override the default
623 .\"O password prompt and use a custom one.  The following percent (`\f(CW\*(C`%\*(C'\fR')
624 .\"O escapes are supported by the \fIsudoers\fR policy:
625 \&\fB\-p\fR (\fIprompt\fR) オプションを使うと、
626 デフォルトのパスワードプロンプトを変更して、好きな文句にすることができる。
627 \&\fIsudoers\fR ポリシーでは以下のパーセント (`\f(CW\*(C`%\*(C'\fR')
628 エスケープが使用できる。
629 .RS 12
630 .ie n .IP "%H" 4
631 .el .IP "\f(CW%H\fR" 4
632 .IX Item "%H"
633 .\"O expanded to the host name including the domain name (on if
634 .\"O the machine's host name is fully qualified or the \fIfqdn\fR option
635 .\"O is set in \fIsudoers\fR\|(5))
636 ドメイン名を含むホスト名に展開される (マシンのホスト名が完全修飾名であるか、
637 \&\fIsudoers\fR\|(5) で \fIfqdn\fR オプションがセットされている場合に有効)
638 .ie n .IP "%h" 4
639 .el .IP "\f(CW%h\fR" 4
640 .IX Item "%h"
641 .\"O expanded to the local host name without the domain name
642 ドメイン名なしのローカルホスト名に展開
643 .ie n .IP "%p" 4
644 .el .IP "\f(CW%p\fR" 4
645 .IX Item "%p"
646 .\"O expanded to the name of the user whose password is being requested
647 .\"O (respects the \fIrootpw\fR, \fItargetpw\fR and \fIrunaspw\fR flags in
648 .\"O \&\fIsudoers\fR\|(5))
649 パスワードを要求されるユーザ名に展開 (\fIsudoers\fR\|(5) の
650 \&\fIrootpw\fR, \fItargetpw\fR, \fIrunaspw\fR フラグを尊重する)
651 .ie n .IP "%U" 4
652 .el .IP "\f(CW%U\fR" 4
653 .IX Item "%U"
654 .\"O expanded to the login name of the user the command will be run as
655 .\"O (defaults to root unless the \f(CW\*(C`\-u\*(C'\fR option is also specified)
656 変身対象になるユーザ (\f(CW\*(C`\-u\*(C'\fR
657 オプションが同時に指定されていない場合は、root がデフォルト)
658 のログイン名に展開される
659 .ie n .IP "%u" 4
660 .el .IP "\f(CW%u\fR" 4
661 .IX Item "%u"
662 .\"O expanded to the invoking user's login name
663 \&\fBsudo\fR を起動するユーザのログイン名に展開される
664 .ie n .IP "\*(C`%%\*(C'" 4
665 .el .IP "\f(CW\*(C`%%\*(C'\fR" 4
666 .IX Item "%%"
667 .\"O two consecutive \f(CW\*(C`%\*(C'\fR characters are collapsed into a single \f(CW\*(C`%\*(C'\fR character
668 連続した二つの \f(CW\*(C`%\*(C'\fR は、一個の \f(CW\*(C`%\*(C'\fR
669 文字そのものを意味する
670 .RE
671 .RS 12
672 .Sp
673 .\"O The prompt specified by the \fB\-p\fR option will override the system
674 .\"O password prompt on systems that support \s-1PAM\s0 unless the
675 .\"O \&\fIpassprompt_override\fR flag is disabled in \fIsudoers\fR.
676 \&\fB\-p\fR で指定したプロンプトが、\s-1PAM\s0
677 をサポートしているシステムで、システムのパスワードプロンプトを上書きするのは、
678 \&\fIsudoers\fR で \fIpassprompt_override\fR が有効になっている場合である
679 (訳注: 実際にはもうすこし複雑なので、\fIsudoers\fR\|(5) の
680 passprompt_override の項も参照してほしい)。
681 .RE
682 .if \n(SL \{\
683 .IP "\-r \fIrole\fR" 12
684 .IX Item "-r role"
685 .\"O The \fB\-r\fR (\fIrole\fR) option causes the new (SELinux) security context to 
686 .\"O have the role specified by \fIrole\fR.
687 \&\fB\-r\fR (\fIrole\fR) オプションを使うと、(SELinux の)
688 新しいセキュリティ・コンテキストが \fIrole\fR
689 で指定されたロールを持つようになる。
690 \}
691 .IP "\-S" 12
692 .IX Item "-S"
693 .\"O The \fB\-S\fR (\fIstdin\fR) option causes \fBsudo\fR to read the password from
694 .\"O the standard input instead of the terminal device.  The password must
695 .\"O be followed by a newline character.
696 \&\fB\-S\fR (\fIstdin\fR) オプションを指定すると、
697 \&\fBsudo\fR はパスワードをターミナルデバイスからではなく、
698 標準入力から読み込む。パスワードは末尾に改行を付けなければならない。
699 .IP "\-s [command]" 12
700 .IX Item "-s [command]"
701 .\"O The \fB\-s\fR (\fIshell\fR) option runs the shell specified by the \fI\s-1SHELL\s0\fR
702 .\"O environment variable if it is set or the shell as specified in the
703 .\"O password database.  If a command is specified, it is passed to the
704 .\"O shell for execution via the shell's \fB\-c\fR option.  If no command
705 .\"O is specified, an interactive shell is executed.
706 \&\fB\-s\fR (\fIshell\fR) は、環境変数 \fI\s-1SHELL\s0\fR が設定されていれば、
707 そのシェルを、さもなければ、
708 パスワード・データベースで指定されているシェルを実行する。
709 コマンドが指定されている場合には、それをシェルに渡し、シェルの
710 \&\fB\-c\fR オプションを通じて実行させる。
711 コマンドが指定されていなければ、対話的シェルを開く。
712 .if \n(SL \{\
713 .IP "\-t \fItype\fR" 12
714 .\"O .IX Item "-t type"
715 .\"O The \fB\-t\fR (\fItype\fR) option causes the new (SELinux) security context to 
716 .\"O have the type specified by \fItype\fR.  If no type is specified, the default
717 .\"O type is derived from the specified role.
718 \&\fB\-t\fR (\fItype\fR) オプションを使用すると、(SELinux の)
719 新しい セキュリティ・コンテキストが \fItype\fR
720 で指定されたタイプを持つようになる。
721 type が指定されない場合は、デフォルトのタイプが、
722 指定された role から導き出される。
723 \}
724 .IP "\-U \fIuser\fR" 12
725 .IX Item "-U user"
726 .\"O The \fB\-U\fR (\fIother user\fR) option is used in conjunction with the
727 .\"O \&\fB\-l\fR option to specify the user whose privileges should be listed.
728 .\"O The security policy may restrict listing other users' privileges.
729 .\"O The \fIsudoers\fR policy only allows root or a user with the \f(CW\*(C`ALL\*(C'\fR
730 .\"O privilege on the current host to use this option.
731 \&\fB\-U\fR (\fIother user\fR) オプションは、\fB\-l\fR と組み合わせて使用し、
732 誰の権限の一覧を表示するかを指定する。自分以外のユーザの権限の表示は、
733 セキュリティ・ポリシーによって禁止されているかもしれない。
734 \&\fIsudoers\fR ポリシーでこのオプションの使用が認められているのは、
735 root ユーザを別にすると、現在使用中のホストで許可するコマンドに
736 \&\f(CW\*(C`ALL\*(C'\fR が指定してあるユーザだけである。
737 .IP "\-u \fIuser\fR" 12
738 .IX Item "-u user"
739 .\"O The \fB\-u\fR (\fIuser\fR) option causes \fBsudo\fR to run the specified
740 .\"O command as a user other than \fIroot\fR.  To specify a \fIuid\fR instead
741 .\"O of a \fIuser name\fR, use \fI#uid\fR.  When running commands as a \fIuid\fR,
742 .\"O many shells require that the '#' be escaped with a backslash ('\e').
743 .\"O Security policies may restrict \fIuid\fRs to those listed in the
744 .\"O password database.  The \fIsudoers\fR policy allows \fIuid\fRs that are
745 .\"O not in the password database as long as the \fItargetpw\fR option is
746 .\"O not set.  Other security policies may not support this.
747 \&\fB\-u\fR (\fIuser\fR) オプションを指定すると、\fBsudo\fR
748 は 指定されたコマンドを \fIroot\fR 以外のユーザとして実行する。
749 ユーザ名の代わりに \fIuid\fR を指定するときは、\fI#uid\fR という書き方をする。
750 多くのシェルでは、\fIuid\fR の資格でコマンドを実行するときは、
751 \&'#' をバックスラッシュ ('\e') でエスケープしなければならない。
752 セキュリティ・ポリシーによっては、使用できる \fIuid\fR
753 をパスワード・データベースに記載されているものに限定していることもある。
754 \&\fIsudoers\fR ポリシーでは、
755 \&\fItargetpw\fR オプションが設定されていないかぎり、
756 パスワード・データベースに存在しない \fIuid\fR も認めている。
757 他のセキュリティ・ポリシーでは、これは許されないかもしれない。
758 .IP "\-V" 12
759 .IX Item "-V"
760 .\"O The \fB\-V\fR (\fIversion\fR) option causes \fBsudo\fR to print its version
761 .\"O string and the version string of the security policy plugin and any
762 .\"O I/O plugins.  If the invoking user is already root the \fB\-V\fR option
763 .\"O will display the arguments passed to configure when \fIsudo\fR was
764 .\"O built and plugins may display more verbose information such as
765 .\"O default options.
766 \&\fB\-V\fR (\fIversion\fR) オプションを指定すると、
767 \&\fBsudo\fR はそのバージョン文字列を、セキュリティ・ポリシー・プラグインや
768 I/O プラグインのバージョン文字列とともに表示する。
769 \&\fBsudo \-V\fR を実行するユーザがあらかじめ root になっている場合は、
770 \&\fIsudo\fR がビルドされたときに configure
771 スクリプトに渡された引数が表示される。また、プラグインについても、
772 デフォルト・オプションのようなより詳細な情報が表示されるかもしれない。
773 .IP "\-v" 12
774 .IX Item "-v"
775 .\"O When given the \fB\-v\fR (\fIvalidate\fR) option, \fBsudo\fR will update the
776 .\"O user's cached credentials, authenticating the user's password if
777 .\"O necessary.  For the \fIsudoers\fR plugin, this extends the \fBsudo\fR
778 .\"O timeout for another \f(CW\*(C`5\*(C'\fR minutes (or whatever the timeout
779 .\"O is set to in \fIsudoers\fR) but does not run a command.  Not all
780 .\"O security policies support cached credentials.
781 \&\fB\-v\fR (\fIvalidate\fR) オプションを指定すると、\fBsudo\fR は
782 ユーザの保存された認証情報を更新する。このとき、必要ならば、
783 パスワードによる認証を行う。\fIsudoers\fR プラグインでは、
784 このオプションによって \fBsudo\fR のタイムアウト時間がもう
785 \&\f(CW\*(C`5\*(C'\fR 分間 (あるいは、何分であれ、\fIsudoers\fR
786 で設定されたタイムアウト時間) 伸びるが、
787 このオプションがコマンドを実行することはない。
788 すべてのセキュリティ・ポリシーが認証情報の一時保存に対応しているわけではない。
789 .IP "\-\-" 12
790 .\"O The \fB\-\-\fR option indicates that \fBsudo\fR should stop processing command
791 .\"O line arguments.
792 \&\fB\-\-\fR オプションがあると、
793 \&\fBsudo\fR はそこでコマンドライン引き数の処理をやめる。
794 .IP "[\fB訳注\fR]:" 8
795 .IX Item "footnote1"
796 このほか、sudo-1.8.4 ではなくなったが、sudo-1.8.3 には \fB\-D\fR
797 というオプションも存在した。ご参考のため挙げておくと、次のようなものである。
798 .RS 4
799 .IP "\-D \fIlevel\fR" 12
800 .IX Item "-D level"
801 \&\fBsudo\fR そのもの、及び \fBsudo\fR プラグインのデバッグを有効にする。
802 \&\fIlevel\fR には 1 から 9 までの値を指定できる。
803 .RE
804 .PP
805 .\"O Environment variables to be set for the command may also be passed
806 .\"O on the command line in the form of \fB\s-1VAR\s0\fR=\fIvalue\fR, e.g.
807 .\"O \&\fB\s-1LD_LIBRARY_PATH\s0\fR=\fI/usr/local/pkg/lib\fR.  Variables passed on the
808 .\"O command line are subject to the same restrictions as normal environment
809 .\"O variables with one important exception.  If the \fIsetenv\fR option
810 .\"O is set in \fIsudoers\fR, the command to be run has the \f(CW\*(C`SETENV\*(C'\fR tag
811 .\"O set or the command matched is \f(CW\*(C`ALL\*(C'\fR, the user may set variables
812 .\"O that would otherwise be forbidden.  See \fIsudoers\fR\|(5) for more information.
813 さらに、コマンドのためにセットしたい環境変数も、\fB\s-1VAR\s0\fR=\fIvalue\fR、
814 たとえば \fB\s-1LD_LIBRARY_PATH\s0\fR=\fI/usr/local/pkg/lib\fR
815 といった形でコマンドラインから渡すことができる。
816 コマンドラインから渡される変数は、通常の環境変数と同じ制限の対象になるが、
817 一つだけ重要な違いがある。\fIsudoers\fR で \fIsetenv\fR
818 オプションが設定されているか、実行されるコマンドに
819 \&\f(CW\*(C`SETENV\*(C'\fR タグがついているか、
820 あるいは、マッチするコマンドが \f(CW\*(C`ALL\*(C'\fR である場合は、
821 ユーザがほかの状況でなら禁じられているような変数をセットすることができるのだ。
822 詳細については \fIsudoers\fR\|(5) を参照してほしい。
823 .\"O .SH "PLUGINS"
824 .SH "プラグイン"
825 .IX Header "PLUGINS"
826 .\"O Plugins are dynamically loaded based on the contents of the
827 .\"O \&\fI/etc/sudo.conf\fR file.  If no \fI/etc/sudo.conf\fR
828 .\"O file is present, or it contains no \f(CW\*(C`Plugin\*(C'\fR lines, \fBsudo\fR
829 .\"O will use the traditional \fIsudoers\fR security policy and I/O logging,
830 .\"O which corresponds to the following \fI/etc/sudo.conf\fR file.
831 プラグインは \fI/etc/sudo.conf\fR の内容に基づいて、動的にロードされる。
832 \&\fI/etc/sudo.conf\fR が存在しない場合や、存在しても
833 \&\f(CW\*(C`Plugin\*(C'\fR の行がない場合は、
834 \&\fBsudo\fR はこれまでどおり、
835 \&\fIsudoers\fR のセキュリティ・ポリシーと I/O ロギングを使用する。
836 それは、次のように \fI/etc/sudo.conf\fR ファイルに記述するのと同じことである。
837 .PP
838 .Vb 10
839 \& #
840 \& # Default /etc/sudo.conf file
841 \& #
842 .\"O \& # Format:
843 \& # 書式:
844 \& #   Plugin plugin_name plugin_path
845 \& #   Path askpass /path/to/askpass
846 \& #   Path noexec /path/to/noexec.so
847 \& #   Debug sudo /var/log/sudo_debug all@warn
848 \& #   Set disable_coredump true
849 \& #
850 .\"O \& # The plugin_path is relative to /usr/local/libexec unless
851 .\"O \& #   fully qualified.
852 .\"O \& # The plugin_name corresponds to a global symbol in the plugin
853 .\"O \& #   that contains the plugin interface structure.
854 \& # The plugin_path が絶対パスでない場合は、 /usr/local/libexec からの
855 \& # 相対パスである。、
856 \& # plugin_name は、プラグイン中の、プラグインのインターフェース構造を
857 \& # 含むグローバルシンボルと同じものである。
858 \& #
859 \& Plugin policy_plugin sudoers.so
860 \& Plugin io_plugin sudoers.so
861 .Ve
862 .PP
863 .\"O A \f(CW\*(C`Plugin\*(C'\fR line consists of the \f(CW\*(C`Plugin\*(C'\fR keyword, followed by the
864 .\"O \&\fIsymbol_name\fR and the \fIpath\fR to the shared object containing the
865 .\"O plugin.  The \fIsymbol_name\fR is the name of the \f(CW\*(C`struct policy_plugin\*(C'\fR
866 .\"O or \f(CW\*(C`struct io_plugin\*(C'\fR in the plugin shared object.  The \fIpath\fR
867 .\"O may be fully qualified or relative.  If not fully qualified it is
868 .\"O relative to the \fI/usr/local/libexec\fR directory.  Any additional
869 .\"O parameters after the \fIpath\fR are ignored.  Lines that don't begin
870 .\"O with \f(CW\*(C`Plugin\*(C'\fR or \f(CW\*(C`Path\*(C'\fR are silently ignored
871 \&\f(CW\*(C`Plugin\*(C'\fR 行は、キーワード \f(CW\*(C`Plugin\*(C'\fR に始まり、
872 \&\fIsymbol_name\fR と \fIpath\fR が続く。\fIpath\fR は、
873 プラグインを含む共有オブジェクト・ファイルへのパスである。
874 \&\fIsymbol_name\fR はプラグイン共有オブジェクト中の構造体
875 \&\f(CW\*(C`policy_plugin\*(C'\fR や構造体 \f(CW\*(C`io_plugin\*(C'\fR
876 の名前である。 \fIpath\fR は絶対パスでも相対パスでもよい。
877 相対パスの場合は、
878 \&\fI/usr/local/libexec\fR ディレクトリを基点にした相対パスである。
879 \&\fIpath\fR の後ろに他のパラメータを付けても、無視される。
880 \&\f(CW\*(C`Plugin\*(C'\fR や \f(CW\*(C`Path\*(C'\fR で始まらない行は、
881 ただ単に無視される。
882 .IP "[\fB訳注\fR]:" 8
883 .IX Item "footnote2"
884 sudo-1.8.3 までは、キーワードに \f(CW\*(C`Plugin\*(C'\fR と
885 \&\f(CW\*(C`Path\*(C'\fR しか使用できなかった。
886 sudo-1.8.4 以上では、上記書式にもあるように、\f(CW\*(C`Debug\*(C'\fR や
887 \&\f(CW\*(C`Set\*(C'\fR で始まる行も有効である。「デバッグ・フラグ」や
888 「セキュリティに関する注意点」セクションも参照していただきたい。
889 .PP
890 .\"O For more information, see the \fIsudo_plugin\fR\|(8) manual.
891 詳細については、\fIsudo_plugin\fR\|(8) のマニュアルをご覧になること。
892 .\"O .SH "PATHS"
893 .SH "パス"
894 .IX Header "PATHS"
895 .\"O A \f(CW\*(C`Path\*(C'\fR line consists of the \f(CW\*(C`Path\*(C'\fR keyword, followed by the
896 .\"O name of the path to set and its value.  E.g.
897 \&\f(CW\*(C`Path\*(C'\fR 行は、キーワード \f(CW\*(C`Path\*(C'\fR に始まり、
898 設定するパスの名前とその値が続く。一例を挙げる。
899 .PP
900 .Vb 2
901 \& Path noexec /usr/local/libexec/sudo_noexec.so
902 \& Path askpass /usr/X11R6/bin/ssh\-askpass
903 .Ve
904 .PP
905 .\"O The following plugin-agnostic paths may be set in the
906 .\"O \&\fI/etc/sudo.conf\fR file.
907 次のようなプラグインではないプログラムやライブラリのパスを
908 \&\fI/etc/sudo.conf\fR ファイルで設定することができる。
909 .IP "askpass" 16
910 .IX Item "askpass"
911 .\"O The fully qualified path to a helper program used to read the user's
912 .\"O password when no terminal is available.  This may be the case when
913 .\"O \&\fBsudo\fR is executed from a graphical (as opposed to text-based)
914 .\"O application.  The program specified by \fIaskpass\fR should display
915 .\"O the argument passed to it as the prompt and write the user's password
916 .\"O to the standard output.  The value of \fIaskpass\fR may be overridden
917 .\"O by the \f(CW\*(C`SUDO_ASKPASS\*(C'\fR environment variable.
918 端末が利用できないときに、
919 ユーザのパスワードを読み込むのに使用するヘルパー・プログラムの絶対パス。
920 たとえば、 \fBsudo\fR がグラフィカルな (つまり、テキストベースではない)
921 アプリケーションから実行される場合がこれに当たる。
922 \&\fIaskpass\fR で指定されたプログラムは、
923 自分に渡された引数をプロンプトとして表示し、
924 ユーザのパスワードを標準出力に書き出すべきである。
925 \&\fIaskpass\fR の値は、環境変数
926 \&\f(CW\*(C`SUDO_ASKPASS\*(C'\fR によって上書きすることができる。
927 .IP "noexec" 16
928 .IX Item "noexec"
929 .\"O The fully-qualified path to a shared library containing dummy
930 .\"O versions of the \fIexecv()\fR, \fIexecve()\fR and \fIfexecve()\fR library functions
931 .\"O that just return an error.  This is used to implement the \fInoexec\fR
932 .\"O functionality on systems that support \f(CW\*(C`LD_PRELOAD\*(C'\fR or its equivalent.
933 .\"O Defaults to \fI/usr/local/libexec/sudo_noexec.so\fR.
934 ライブラリ関数 \fIexecv()\fR, \fIexecve()\fR, \fIfexecve()\fR のダミー版
935 (単にエラーを返すだけの関数) が入っている共有ライブラリの絶対パス。
936 これは \f(CW\*(C`LD_PRELOAD\*(C'\fR
937 やそれに相当するものをサポートしているシステムで
938 \&\fInoexec\fR 機能を実現するために使用される。
939 デフォルトでは  \fI/usr/local/libexec/sudo_noexec.so\fR になっている。
940 .\"O .SH "DEBUG FLAGS"
941 .SH "デバッグ・フラグ (sudo-1.8.4 の新機能)"
942 .IX Header "DEBUG FLAGS"
943 .\"O \&\fBsudo\fR versions 1.8.4 and higher support a flexible debugging
944 .\"O framework that can help track down what \fBsudo\fR is doing internally
945 .\"O if there is a problem.
946 .\"O .PP
947 バージョン 1.8.4 以上の \fBsudo\fR は、
948 デバッグのための柔軟な枠組みに対応しており、問題が発生したときに、
949 \&\fBsudo\fR の内部で何が起きているかを突き止めるために、
950 これを利用することができる。
951 .PP
952 .\"O A \f(CW\*(C`Debug\*(C'\fR line consists of the \f(CW\*(C`Debug\*(C'\fR keyword, followed by the
953 .\"O name of the program to debug (\fBsudo\fR, \fBvisudo\fR, \fBsudoreplay\fR),
954 .\"O the debug file name and a comma-separated list of debug flags.
955 .\"O The debug flag syntax used by \fBsudo\fR and the \fIsudoers\fR plugin is
956 .\"O \&\fIsubsystem\fR@\fIpriority\fR but the plugin is free to use a different
957 .\"O format so long as it does not include a command \f(CW\*(C`,\*(C'\fR.
958 .\"O .PP
959 \&\f(CW\*(C`Debug\*(C'\fR 行の構成は、\f(CW\*(C`Debug\*(C'\fR
960 というキーワードに始まり、それに、デバッグ対象のプログラム名
961 (\fBsudo\fR, \fBvisudo\fR, \fBsudoreplay\fR) とデバッグファイル名が続き、
962 最後にコンマで区切ったデバッグ・フラグのリストが来るという形になっている
963 (訳注: \f(CW\*(C`Debug\*(C'\fR 行も \fI/etc/sudo.conf\fR に記載する)。
964 デバッグフラグのシンタクスは、\&\fBsudo\fR と \fIsudoers\fR プラグインでは、
965 \&\fIsubsystem\fR@\fIpriority\fR という書式を用いるが、
966 「\f(CW\*(C`,\*(C'\fR」というコマンドを含まないかぎり、
967 プラグインが別の書式を使っても構わない。
968 .PP
969 \"O For instance:
970 .\"O .PP
971 一例を挙げよう。
972 .PP
973 .Vb 1
974 \& Debug sudo /var/log/sudo_debug all@warn,plugin@info
975 .Ve
976 .PP
977 .\"O would log all debugging statements at the \fIwarn\fR level and higher
978 .\"O in addition to those at the \fIinfo\fR level for the plugin subsystem.
979 .\"O .PP
980 上記のように指定すれば、\fIwarn\fR レベル以上のすべてのデバッグメッセージを
981 ログに記録することになる。さらに、plugin サブシステムに関しては、
982 \&\fIinfo\fR レベルのメッセージも記録する。 
983 .PP
984 .\"O Currently, only one \f(CW\*(C`Debug\*(C'\fR entry per program is supported.  The
985 .\"O \&\f(CW\*(C`sudo\*(C'\fR \f(CW\*(C`Debug\*(C'\fR entry is shared by the \fBsudo\fR front end, \fBsudoedit\fR
986 .\"O and the plugins.  A future release may add support for per-plugin
987 .\"O \&\f(CW\*(C`Debug\*(C'\fR lines and/or support for multiple debugging files for a
988 .\"O single program.
989 .\"O .PP
990 現在のところ、一プログラムあたり一行の \f(CW\*(C`Debug\*(C'\fR
991 エントリしか使用できない。プログラム名が \f(CW\*(C`sudo\*(C'\fR の
992 \&\f(CW\*(C`Debug\*(C'\fR 行は、\fBsudo\fR フロントエンド、\fBsudoedit\fR、
993 及び \fBsudo\fR のプラグインによって共有される。将来のリリースでは、
994 プラグインごとの \f(CW\*(C`Debug\*(C'\fR 行をサポートするかもしれない。
995 また、一つのプログラムに対する複数のデバッグファイルをサポートするかもしれない。
996 .PP
997 .\"O The priorities used by the \fBsudo\fR front end, in order of decreasing
998 .\"O severity, are: \fIcrit\fR, \fIerr\fR, \fIwarn\fR, \fInotice\fR, \fIdiag\fR, \fIinfo\fR,
999 .\"O \&\fItrace\fR and \fIdebug\fR.  Each priority, when specified, also includes
1000 .\"O all priorities higher than it.  For example, a priority of \fInotice\fR
1001 .\"O would include debug messages logged at \fInotice\fR and higher.
1002 .\"O .PP
1003 \&\fBsudo\fR フロントエンドが使用する priority (重大度) を
1004 深刻なものから挙げると、\fIcrit\fR, \fIerr\fR, \fIwarn\fR, \fInotice\fR,
1005 \&\fIdiag\fR, \fIinfo\fR, \fItrace\fR, \fIdebug\fR である。
1006 ある  priority を指定すると、
1007 それよりも深刻なすべての priority も同時に指定したことになる。
1008 たとえば、\fInotice\fR という priority を指定すれば、 \fInotice\fR
1009 レベル以上のデバッグメッセージがログに記録されるわけである。
1010 .PP
1011 .\"O The following subsystems are used by \fBsudo\fR:
1012 \&\fBsudo\fR では以下のサブシステムが使用できる。
1013 .IP "\fIall\fR" 10
1014 .IX Item "all"
1015 .\"O matches every subsystem
1016 あらゆるサブシステムにマッチする
1017 .IP "\fIargs\fR" 10
1018 .IX Item "args"
1019 .\"O command line argument processing
1020 コマンドライン引数の処理
1021 .IP "\fIconv\fR" 10
1022 .IX Item "conv"
1023 .\"O user conversation
1024 ユーザとのやりとり
1025 .IP "\fIedit\fR" 10
1026 .IX Item "edit"
1027 .\"O sudoedit
1028 sudoedit
1029 .IP "\fIexec\fR" 10
1030 .IX Item "exec"
1031 .\"O command execution
1032 コマンドの実行
1033 .IP "\fImain\fR" 10
1034 .IX Item "main"
1035 .\"O \&\fBsudo\fR main function
1036 \&\fBsudo\fR のメイン関数
1037 .IP "\fInetif\fR" 10
1038 .IX Item "netif"
1039 .\"O network interface handling
1040 ネットワーク・インターフェースの取扱い
1041 .IP "\fIpcomm\fR" 10
1042 .IX Item "pcomm"
1043 .\"O communication with the plugin
1044 プラグインとのやりとり
1045 .IP "\fIplugin\fR" 10
1046 .IX Item "plugin"
1047 .\"O plugin configuration
1048 プラグインの設定
1049 .IP "\fIpty\fR" 10
1050 .IX Item "pty"
1051 .\"O pseudo-tty related code
1052 擬似端末に関連したコード
1053 .IP "\fIselinux\fR" 10
1054 .IX Item "selinux"
1055 .\"O SELinux-specific handling
1056 SELinux に特有の取扱い
1057 .IP "\fIutil\fR" 10
1058 .IX Item "util"
1059 .\"O utility functions
1060 ユーティリティ関数群
1061 .IP "\fIutmp\fR" 10
1062 .IX Item "utmp"
1063 .\"O utmp handling
1064 utmp の取扱い
1065 .\"O .SH "RETURN VALUES"
1066 .SH "返り値"
1067 .IX Header "RETURN VALUES"
1068 .\"O Upon successful execution of a program, the exit status from \fBsudo\fR
1069 .\"O will simply be the exit status of the program that was executed.
1070 プログラムの実行に成功した場合、\fBsudo\fR が返す終了ステータスは、
1071 実行したプログラムの終了ステータスそのものである。
1072 .PP
1073 .\"O Otherwise, \fBsudo\fR exits with a value of 1 if there is a
1074 .\"O configuration/permission problem or if \fBsudo\fR cannot execute the
1075 .\"O given command.  In the latter case the error string is printed to
1076 .\"O the standard error.  If \fBsudo\fR cannot \fIstat\fR\|(2) one or more entries
1077 .\"O in the user's \f(CW\*(C`PATH\*(C'\fR, an error is printed on stderr.  (If the
1078 .\"O directory does not exist or if it is not really a directory, the
1079 .\"O entry is ignored and no error is printed.)  This should not happen
1080 .\"O under normal circumstances.  The most common reason for \fIstat\fR\|(2)
1081 .\"O to return \*(L"permission denied\*(R" is if you are running an automounter
1082 .\"O and one of the directories in your \f(CW\*(C`PATH\*(C'\fR is on a machine that is
1083 .\"O currently unreachable.
1084 そうでない場合、設定やパーミッションに問題があったり、
1085 \&\fBsudo\fR が指定されたコマンドを実行できなかったりしたときは、
1086 \&\fBsudo\fR は返り値 1 で終了する。
1087 後者の場合は、エラーメッセージが標準エラーに表示される。
1088 また、\fBsudo\fR がユーザの \f(CW\*(C`PATH\*(C'\fR
1089 にある一つ以上のエントリを \fIstat\fR\|(2) できなかったときも、
1090 エラーが標準エラーに出力される (ただし、そのディレクトリが存在しなかったり、
1091 実際にはディレクトリでなかったりした場合は、
1092 そのエントリは無視され、エラーは表示されない)。そうしたことは、
1093 正常な環境では起きないはずのことである。\fIstat\fR\|(2) が
1094 \&\*(L"permission denied\*(R" を返す理由で一番よくあるのは、
1095 ユーザーがオートマウントを使用していて、\f(CW\*(C`PATH\*(C'\fR
1096 にあるディレクトリの一つが目下到達不可能なマシンにある場合だ。
1097 .\"O .SH "SECURITY NOTES"
1098 .SH "セキュリティに関する注意点"
1099 .IX Header "SECURITY NOTES"
1100 .\"O \&\fBsudo\fR tries to be safe when executing external commands.
1101 \&\fBsudo\fR は外部のコマンドをできるだけ安全に実行しようとする。
1102 .PP
1103 .\"O To prevent command spoofing, \fBsudo\fR checks \*(L".\*(R" and "" (both denoting
1104 .\"O current directory) last when searching for a command in the user's
1105 .\"O \&\s-1PATH\s0 (if one or both are in the \s-1PATH\s0).  Note, however, that the
1106 .\"O actual \f(CW\*(C`PATH\*(C'\fR environment variable is \fInot\fR modified and is passed
1107 .\"O unchanged to the program that \fBsudo\fR executes.
1108 偽コマンドの実行 (command spoofing) を防止するため、
1109 \&\fBsudo\fR はコマンドを捜してユーザの \s-1PATH\s0 を検索する際に、
1110 \&\*(L".\*(R" と "" (どちらもカレントディレクトリを意味する) を最後に調べる
1111 (そのどちらか、あるいは両方が \s-1PATH\s0 中に存在すればだが)。
1112 とは言え、環境変数 \f(CW\*(C`PATH\*(C'\fR そのものは変更されずに、
1113 そのまま \fBsudo\fR が実行するプログラムに渡されることに注意してほしい。
1114 .PP
1115 .\"O Please note that \fBsudo\fR will normally only log the command it
1116 .\"O explicitly runs.  If a user runs a command such as \f(CW\*(C`sudo su\*(C'\fR or
1117 .\"O \&\f(CW\*(C`sudo sh\*(C'\fR, subsequent commands run from that shell are not subject
1118 .\"O to \fBsudo\fR's security policy.  The same is true for commands that
1119 .\"O offer shell escapes (including most editors).  If I/O logging is
1120 .\"O enabled, subsequent commands will have their input and/or output
1121 .\"O logged, but there will not be traditional logs for those commands.
1122 .\"O Because of this, care must be taken when giving users access to
1123 .\"O commands via \fBsudo\fR to verify that the command does not inadvertently
1124 .\"O give the user an effective root shell.  For more information, please
1125 .\"O see the \f(CW\*(C`PREVENTING SHELL ESCAPES\*(C'\fR section in \fIsudoers\fR\|(5).
1126 .\"O .PP
1127 \&\fBsudo\fR は通常、
1128 自分が明示的に実行したコマンドしかログに記録しないことに気を付けてほしい。
1129 ユーザが \f(CW\*(C`sudo su\*(C'\fR や \f(CW\*(C`sudo sh\*(C'\fR
1130 といったコマンドを実行した場合、そのシェルから続いて実行されるコマンドは
1131 \&\fBsudo\fR のセキュリティ・ポリシーの対象にならない。
1132 シェル・エスケープを提供するコマンドについても (たいていのエディタが
1133 それに含まれる) 同じことが言える。
1134 確かに、I/O ロギングが有効になっている場合は、
1135 シェルから続いて実行されるコマンドも、その入力や出力を記録されることになるが、
1136 従来からあるログに記録されるわけではないのである。
1137 こうしたことから、ユーザに \fBsudo\fR 経由でコマンドの使用を許すときは、
1138 そのコマンドが事実上ルート・シェルをうっかりユーザに与えていないかを、
1139 念には念を入れて確認しなければならない。もっと詳しいことが知りたかったら、
1140 \&\fIsudoers\fR\|(5) の「シェル・エスケープを防止する」
1141 のセクションを御覧になるとよい。
1142 .PP
1143 .\"O To prevent the disclosure of potentially sensitive information,
1144 .\"O \&\fBsudo\fR disables core dumps by default while it is executing (they
1145 .\"O are re-enabled for the command that is run).  To aid in debugging
1146 .\"O \&\fBsudo\fR crashes, you may wish to re-enable core dumps by setting
1147 .\"O \&\*(L"disable_coredump\*(R" to false in the \fI/etc/sudo.conf\fR file.
1148 .\"O .PP
1149 セキュリティ上問題になりかねない情報を漏洩しないように、
1150 \&\fBsudo\fR はデフォルトでは、自己を実行中のコアダンプを抑止している
1151 (指定されたコマンドを実行するときには、コアダンプを有効にし直すのである)。
1152 \&\fBsudo\fR そのもののクラッシュをデバッグするために、
1153 コアダンプを有効に戻したいならば、
1154 \&\fI/etc/sudo.conf\fR ファイルで \*(L"disable_coredump\*(R" を
1155 false にすればよい。(訳注: キーワード Set は sudo-1.8.4 以上でなければ、
1156 使用できない。)
1157 .PP
1158 .Vb 1
1159 \& Set disable_coredump false
1160 .Ve
1161 .PP
1162 .\"O Note that by default, most operating systems disable core dumps
1163 .\"O from setuid programs, which includes \fBsudo\fR.  To actually get a
1164 .\"O \&\fBsudo\fR core file you may need to enable core dumps for setuid
1165 .\"O processes.  On \s-1BSD\s0 and Linux systems this is accomplished via the
1166 .\"O sysctl command, on Solaris the coreadm command can be used.
1167 注意してほしいのは、たいていのオペレーティングシステムが、
1168 デフォルトでは setuid プログラムのコアダンプを抑止していることだ。
1169 \&\fBsudo\fR もそうしたプログラムの一つである。
1170 そこで、実際に \fBsudo\fR のコアダンプ・ファイルを取得するには、
1171 setuid プロセスに対するコアダンプを有効にする必要があるかもしれない。
1172 \&\s-1BSD\s0 や Linux のシステムでは、これは sysctl コマンドによって行われる。 
1173 Solaris では coreadm コマンドが使用できる。
1174 .\"O .SH "ENVIRONMENT"
1175 .SH "環境変数"
1176 .IX Header "ENVIRONMENT"
1177 .\"O \&\fBsudo\fR utilizes the following environment variables.  The security
1178 .\"O policy has control over the content of the command's environment.
1179 \&\fBsudo\fR は以下の環境変数を利用する。実行するコマンドの環境の内容は、
1180 セキュリティ・ポリシーによる制御の対象になる。
1181 .ie n .IP "\*(C`EDITOR\*(C'" 16
1182 .el .IP "\f(CW\*(C`EDITOR\*(C'\fR" 16
1183 .IX Item "EDITOR"
1184 .\"O Default editor to use in \fB\-e\fR (sudoedit) mode if neither \f(CW\*(C`SUDO_EDITOR\*(C'\fR
1185 .\"O nor \f(CW\*(C`VISUAL\*(C'\fR is set
1186 環境変数 \f(CW\*(C`SUDO_EDITOR\*(C'\fR や \f(CW\*(C`VISUAL\*(C'\fR
1187 が設定されていないとき、
1188 \&\fB\-e\fR (sudoedit) モードで使用するデフォルトのエディタ
1189 .ie n .IP "\*(C`MAIL\*(C'" 16
1190 .el .IP "\f(CW\*(C`MAIL\*(C'\fR" 16
1191 .IX Item "MAIL"
1192 .\"O In \fB\-i\fR mode or when \fIenv_reset\fR is enabled in \fIsudoers\fR, set
1193 .\"O to the mail spool of the target user
1194 \&\fB\-i\fR オプションが指定された場合や、
1195 \&\fIsudoers\fR で \fIenv_reset\fR が有効になっている場合に、
1196 変身対象ユーザのメールスプールにセットされる
1197 .ie n .IP "\*(C`HOME\*(C'" 16
1198 .el .IP "\f(CW\*(C`HOME\*(C'\fR" 16
1199 .IX Item "HOME"
1200 .\"O Set to the home directory of the target user if \fB\-i\fR or \fB\-H\fR are
1201 .\"O specified, \fIenv_reset\fR or \fIalways_set_home\fR are set in \fIsudoers\fR,
1202 .\"O or when the \fB\-s\fR option is specified and \fIset_home\fR is set in
1203 .\"O \&\fIsudoers\fR
1204 \&\fB\-i\fR や \fB\-H\fR オプションが指定された場合や、
1205 \&\fIsudoers\fR で \fIenv_reset\fR や \fIalways_set_home\fR
1206 が設定されている場合、あるいは \fIsudoers\fR で \fIset_home\fR が設定され、
1207 かつ \fB\-s\fR オプションが指定された場合に、
1208 変身対象ユーザのホームディレクトリにセットされる
1209 .ie n .IP "\*(C`PATH\*(C'" 16
1210 .el .IP "\f(CW\*(C`PATH\*(C'\fR" 16
1211 .IX Item "PATH"
1212 .\"O May be overridden by the security policy.
1213 セキュリティ・ポリシーによってたぶん上書きされる
1214 .ie n .IP "\*(C`SHELL\*(C'" 16
1215 .el .IP "\f(CW\*(C`SHELL\*(C'\fR" 16
1216 .IX Item "SHELL"
1217 .\"O Used to determine shell to run with \f(CW\*(C`\-s\*(C'\fR option
1218 \&\fB\-s\fR オプションで起動するシェルを決めるのに使用する
1219 .ie n .IP "\*(C`SUDO_ASKPASS\*(C'" 16
1220 .el .IP "\f(CW\*(C`SUDO_ASKPASS\*(C'\fR" 16
1221 .IX Item "SUDO_ASKPASS"
1222 .\"O Specifies the path to a helper program used to read the password
1223 .\"O if no terminal is available or if the \f(CW\*(C`\-A\*(C'\fR option is specified.
1224 ターミナルが利用できない場合や、
1225 \&\f(CW\*(C`\-A\*(C'\fR オプションが指定されている場合に、
1226 パスワードを読み込むのに使用するヘルパープログラムのパスを指定する
1227 .ie n .IP "\*(C`SUDO_COMMAND\*(C'" 16
1228 .el .IP "\f(CW\*(C`SUDO_COMMAND\*(C'\fR" 16
1229 .IX Item "SUDO_COMMAND"
1230 .\"O Set to the command run by sudo
1231 sudo が実行するコマンドにセットされる
1232 .ie n .IP "\*(C`SUDO_EDITOR\*(C'" 16
1233 .el .IP "\f(CW\*(C`SUDO_EDITOR\*(C'\fR" 16
1234 .IX Item "SUDO_EDITOR"
1235 .\"O Default editor to use in \fB\-e\fR (sudoedit) mode
1236 \&\fB\-e\fR (sudoedit) モードで使用するデフォルトのエディタ
1237 .ie n .IP "\*(C`SUDO_GID\*(C'" 16
1238 .el .IP "\f(CW\*(C`SUDO_GID\*(C'\fR" 16
1239 .IX Item "SUDO_GID"
1240 .\"O Set to the group \s-1ID\s0 of the user who invoked sudo
1241 sudo を起動したユーザのグループ \s-1ID\s0 にセットされる
1242 .ie n .IP "\*(C`SUDO_PROMPT\*(C'" 16
1243 .el .IP "\f(CW\*(C`SUDO_PROMPT\*(C'\fR" 16
1244 .IX Item "SUDO_PROMPT"
1245 .\"O Used as the default password prompt
1246 デフォルトのパスワード・プロンプトとして使用する
1247 .ie n .IP "\*(C`SUDO_PS1\*(C'" 16
1248 .el .IP "\f(CW\*(C`SUDO_PS1\*(C'\fR" 16
1249 .IX Item "SUDO_PS1"
1250 .\"O If set, \f(CW\*(C`PS1\*(C'\fR will be set to its value for the program being run
1251 設定すると、
1252 実行されるプログラムの \f(CW\*(C`PS1\*(C'\fR がこの変数の値にセットされる
1253 .ie n .IP "\*(C`SUDO_UID\*(C'" 16
1254 .el .IP "\f(CW\*(C`SUDO_UID\*(C'\fR" 16
1255 .IX Item "SUDO_UID"
1256 .\"O Set to the user \s-1ID\s0 of the user who invoked sudo
1257 sudo を起動したユーザのユーザ \s-1ID\s0 にセットされる
1258 .ie n .IP "\*(C`SUDO_USER\*(C'" 16
1259 .el .IP "\f(CW\*(C`SUDO_USER\*(C'\fR" 16
1260 .IX Item "SUDO_USER"
1261 .\"O Set to the login of the user who invoked sudo
1262 sudo を起動したユーザのログイン名にセットされる
1263 .ie n .IP "\*(C`USER\*(C'" 16
1264 .el .IP "\f(CW\*(C`USER\*(C'\fR" 16
1265 .IX Item "USER"
1266 .\"O Set to the target user (root unless the \fB\-u\fR option is specified)
1267 変身対象ユーザにセットされる (オプション \fB\-u\fR が指定されていなければ、
1268 root になる)
1269 .ie n .IP "\*(C`VISUAL\*(C'" 16
1270 .el .IP "\f(CW\*(C`VISUAL\*(C'\fR" 16
1271 .IX Item "VISUAL"
1272 .\"O Default editor to use in \fB\-e\fR (sudoedit) mode if \f(CW\*(C`SUDO_EDITOR\*(C'\fR
1273 .\"O is not set
1274 変数 \f(CW\*(C`SUDO_EDITOR\*(C'\fR が設定されていない場合に、
1275 \&\fB\-e\fR (sudoedit) モードで使用するデフォルトのエディタ
1276 .\"O .SH "FILES"
1277 .SH "ファイル"
1278 .IX Header "FILES"
1279 .ie n .IP "\fI/etc/sudo.conf\fR" 24
1280 .el .IP "\fI/etc/sudo.conf\fR" 24
1281 .IX Item "/etc/sudo.conf"
1282 .\"O \&\fBsudo\fR front end configuration
1283 \&\fBsudo\fR フロントエンドの設定ファイル
1284 .IP "[\fB訳注\fR]:" 8
1285 .IX Item "footnote3"
1286 念のため、次の二つを追加しておく。詳細については \fIsudoers\fR\|(5)
1287 をご覧いただきたい。
1288 .RS 4
1289 .IP "\fI/etc/sudoers\fR" 20
1290 .IX Item "/etc/sudoers"
1291 誰が何を実行できるかを設定するファイル
1292 .IP "\fI/var/lib/sudo\fR" 20
1293 .IX Item "/var/lib/sudo"
1294 \&\fBsudo\fR が認証情報の保存に使用するタイムスタンプを置く、
1295 デフォルトのディレクトリ
1296 .RE
1297 .\"O .SH "EXAMPLES"
1298 .SH "用例"
1299 .IX Header "EXAMPLES"
1300 .\"O Note: the following examples assume a properly configured security policy.
1301 注意: 以下の例は、
1302 セキュリティ・ポリシーが適切に設定されていることを前提にしている。
1303 .PP
1304 .\"O To get a file listing of an unreadable directory:
1305 読み取り不可のディレクトリのファイル一覧を取得する。
1306 .PP
1307 .Vb 1
1308 \& $ sudo ls /usr/local/protected
1309 .Ve
1310 .PP
1311 .\"O To list the home directory of user yaz on a machine where the
1312 .\"O file system holding ~yaz is not exported as root:
1313 ユーザ yaz のホームディレクトリのファイル一覧を取得したいのだが、
1314 ~yaz を含むファイルシステムが別のマシンにあって、
1315 root でアクセスできるようにエクスポートされていない場合。
1316 .PP
1317 .Vb 1
1318 \& $ sudo \-u yaz ls ~yaz
1319 .Ve
1320 .PP
1321 .\"O To edit the \fIindex.html\fR file as user www:
1322 ユーザ www として \fIindex.html\fR ファイルを編集する。
1323 .PP
1324 .Vb 1
1325 \& $ sudo \-u www vi ~www/htdocs/index.html
1326 .Ve
1327 .PP
1328 .\"O To view system logs only accessible to root and users in the adm group:
1329 root と adm グループのユーザだけがアクセスできるシステムログを閲覧する。
1330 .PP
1331 .Vb 1
1332 \& $ sudo \-g adm view /var/log/syslog
1333 .Ve
1334 .PP
1335 .\"O To run an editor as jim with a different primary group:
1336 jim に変身してエディタを実行する。
1337 プライマリグループには別のグループを指定する。
1338 .PP
1339 .Vb 1
1340 \& $ sudo \-u jim \-g audio vi ~jim/sound.txt
1341 .Ve
1342 .PP
1343 .\"O To shutdown a machine:
1344 マシンをリブートする。
1345 .PP
1346 .Vb 1
1347 \& $ sudo shutdown \-r +15 "quick reboot"
1348 .Ve
1349 .PP
1350 .\"O To make a usage listing of the directories in the /home
1351 .\"O partition.  Note that this runs the commands in a sub-shell
1352 .\"O to make the \f(CW\*(C`cd\*(C'\fR and file redirection work.
1353 /home パーティションに存在するディレクトリのディスク使用量リストを作成する。
1354 \&\f(CW\*(C`cd\*(C'\fR やファイル・リダイレクションがきちんと動作するように、
1355 コマンドをサブシェルで実行していることに注目してほしい。
1356 .PP
1357 .Vb 1
1358 \& $ sudo sh \-c "cd /home ; du \-s * | sort \-rn > USAGE"
1359 .Ve
1360 .\"O .SH "SEE ALSO"
1361 .SH "関連項目"
1362 .IX Header "SEE ALSO"
1363 \&\fIgrep\fR\|(1), \fIsu\fR\|(1), \fIstat\fR\|(2),
1364 .if \n(LC \&\fIlogin_cap\fR\|(3),
1365 \&\fIpasswd\fR\|(5), \fIsudoers\fR\|(5), \fIsudo_plugin\fR\|(8), \fIsudoreplay\fR\|(8), \fIvisudo\fR\|(8)
1366 .\"O .SH "AUTHORS"
1367 .SH "作者"
1368 .IX Header "AUTHORS"
1369 .\"O Many people have worked on \fBsudo\fR over the years; this
1370 .\"O version consists of code written primarily by:
1371 多数の人々が長年に渡って \fBsudo\fR の製作に取り組んできた。当バージョ
1372 ンは主として次の者が書いたコードからできている。
1373 .PP
1374 .Vb 1
1375 \&        Todd C. Miller
1376 .Ve
1377 .PP
1378 .\"O See the \s-1CONTRIBUTORS\s0 file in the \fBsudo\fR distribution
1379 .\"O (http://www.sudo.ws/sudo/contributors.html) for a list of people
1380 .\"O who have contributed to \fBsudo\fR.
1381 \&\fBsudo\fR の製作に貢献してくださった方々のリストについては、
1382 \&\fBsudo\fR の配布に含まれる \s-1CONTRIBUTORS\s0 ファイルをご覧いただきたい
1383 (http://www.sudo.ws/sudo/contributors.html)。 
1384 .\"O .SH "HISTORY"
1385 .SH "履歴"
1386 .IX Header "HISTORY"
1387 .\"O See the \s-1HISTORY\s0 file in the \fBsudo\fR distribution
1388 .\"O (http://www.sudo.ws/sudo/history.html) for a brief history of sudo.
1389 \&\fBsudo\fR の簡単な履歴については、
1390 配布物中の \s-1HISTORY\s0 ファイルをご覧いただきたい
1391 (http://www.sudo.ws/sudo/history.html)。
1392 .\"O .SH "CAVEATS"
1393 .SH "警告"
1394 .IX Header "CAVEATS"
1395 .\"O There is no easy way to prevent a user from gaining a root shell
1396 .\"O if that user is allowed to run arbitrary commands via \fBsudo\fR.
1397 .\"O Also, many programs (such as editors) allow the user to run commands
1398 .\"O via shell escapes, thus avoiding \fBsudo\fR's checks.  However, on
1399 .\"O most systems it is possible to prevent shell escapes with the
1400 .\"O \&\fIsudoers\fR\|(5) module's \fInoexec\fR functionality.
1401 ユーザが \fBsudo\fR 経由で任意のコマンドを実行することを許可されているならば、
1402 そのユーザがルート・シェルを獲得するのを防止する簡単な方法はない。
1403 また、(エディタを含む) 多くのプログラムが、
1404 シェル・エスケープを通してユーザがコマンドを実行できるようにしており、
1405 この方法でユーザは \fBsudo\fR のチェックを回避することができる。
1406 とは言え、たいていのシステムでは、
1407 \&\fIsudoers\fR\|(5) モジュールの \fInoexec\fR 機能を用いて、
1408 シェル・エスケープを阻止することが可能である。
1409 .PP
1410 .\"O It is not meaningful to run the \f(CW\*(C`cd\*(C'\fR command directly via sudo, e.g.,
1411 下記のように sudo の中で直に \f(CW\*(C`cd\*(C'\fR
1412 コマンドを実行しても意味がない。
1413 .PP
1414 .Vb 1
1415 \& $ sudo cd /usr/local/protected
1416 .Ve
1417 .PP
1418 .\"O since when the command exits the parent process (your shell) will
1419 .\"O still be the same.  Please see the \s-1EXAMPLES\s0 section for more information.
1420 なぜなら、このコマンドが終了したとき、その親プロセス (つまり、
1421 \&\fBsudo\fR を実行したシェル) は相変わらず元の状態のままだからだ。
1422 より詳しく知りたかったら、「用例」セクションを御覧になってほしい。
1423 .PP
1424 .\"O Running shell scripts via \fBsudo\fR can expose the same kernel bugs that
1425 .\"O make setuid shell scripts unsafe on some operating systems (if your \s-1OS\s0
1426 .\"O has a /dev/fd/ directory, setuid shell scripts are generally safe).
1427 \&\fBsudo\fR を介してシェルスクリプトを実行すると、
1428 ある種のオペレーティングシステムで
1429 setuid シェルスクリプトを危険なものにしているのと同一の、
1430 カーネルのバグが表面化するおそれがある (使用している \s-1OS\s0 に 
1431 /dev/fd/ ディレクトリがあれば、setuid シェルスクリプトはたいてい安全である)。
1432 .\"O .SH "BUGS"
1433 .SH "バグ"
1434 .IX Header "BUGS"
1435 .\"O If you feel you have found a bug in \fBsudo\fR, please submit a bug report
1436 .\"O at http://www.sudo.ws/sudo/bugs/
1437 \&\fBsudo\fR にバクを発見したと思ったら、下記のページにアクセスして、
1438 バグレポートを提出していただきたい。
1439 .br
1440 http://www.sudo.ws/sudo/bugs/
1441 .\"O .SH "SUPPORT"
1442 .SH "サポート"
1443 .IX Header "SUPPORT"
1444 .\"O Limited free support is available via the sudo-users mailing list,
1445 .\"O see http://www.sudo.ws/mailman/listinfo/sudo\-users to subscribe or
1446 .\"O search the archives.
1447 ある程度の無料サポートが sudo-users メーリングリストを通して利用できる。
1448 購読やアーカイブの検索には下記 URL を御覧になること。
1449 .br
1450 http://www.sudo.ws/mailman/listinfo/sudo\-users
1451 .\"O .SH "DISCLAIMER"
1452 .SH "免責"
1453 .IX Header "DISCLAIMER"
1454 .\"O \&\fBsudo\fR is provided ``\s-1AS\s0 \s-1IS\s0'' and any express or implied warranties,
1455 .\"O including, but not limited to, the implied warranties of merchantability
1456 .\"O and fitness for a particular purpose are disclaimed.  See the \s-1LICENSE\s0
1457 .\"O file distributed with \fBsudo\fR or http://www.sudo.ws/sudo/license.html
1458 .\"O for complete details.
1459 \&\fBsudo\fR は「現状のまま」提供される。
1460 明示的な、あるいは黙示的ないかなる保証も、
1461 商品性や特定目的への適合性についての黙示的な保証を含め、
1462 またそれのみに止まらず、これを否認する。詳細な全文については、
1463 \&\fBsudo\fR と一緒に配布されている \s-1LICENSE\s0 ファイルや、
1464 下記 Web ページを御覧いただきたい。
1465 .br
1466 http://www.sudo.ws/sudo/license.html