.\" Copyright (c) 1994-1996, 1998-2005, 2007-2009 .\" Todd C. Miller .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" Sponsored in part by the Defense Advanced Research Projects .\" Agency (DARPA) and Air Force Research Laboratory, Air Force .\" Materiel Command, USAF, under agreement number F39502-99-1-0512. .\" .\" Japanese Version Copyright (c) 2000-2002 Yuichi SATO .\" and 2009 Yoichi Chonan .\" all rights reserved. .\" Translated Sat Oct 7 14:39:18 JST 2000 .\" by Yuichi SATO .\" Updated & Modified Fri Dec 6 04:40:44 JST 2002 by Yuichi SATO .\" New Translation (sudo-1.6.9p17) Fri Jan 23 10:31:17 JST 2009 .\" by Yoichi Chonan .\" Updated & Modified (sudo-1.7.2p1) Sat Nov 14 21:15:16 JST 2009 .\" by Yoichi Chonan .\" Modified Tue Nov 24 20:00:00 JST 2009 by Yoichi Chonan .\" .\" $Sudo: sudoers.man.in,v 1.80 2009/06/30 12:41:09 millert Exp $ .\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.05) .\" .\" Standard preamble: .\" ======================================================================== .de Sh \" Subsection heading .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` . ds C' 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "SUDOERS 5" .TH SUDOERS 5 "June 30, 2009" "1.7.2p1" "MAINTENANCE COMMANDS" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .\"O .SH "NAME" .SH "名前" .\"O sudoers \- list of which users may execute what sudoers \- どのユーザが何を実行できるかのリスト .\"O .SH "DESCRIPTION" .SH "説明" .IX Header "DESCRIPTION" .\"O The \fIsudoers\fR file is composed of two types of entries: aliases .\"O (basically variables) and user specifications (which specify who .\"O may run what). .\"O .PP \&\fIsudoers\fR ファイルは二種類のエントリから構成されている。 (要するに変数である) エイリアスと (誰が何を実行できるかを 指定している) ユーザ設定だ。 .IP "[\fB訳注\fR]:" 8 .IX Item "footnote1" 訳者としては、「エイリアス、デフォルト指定、ユーザ設定の三種類の エントリから構成されている」と言った方が実態に合っているのではないかと思う。 .PP .\"O When multiple entries match for a user, they are applied in order. .\"O Where there are multiple matches, the last match is used (which is .\"O not necessarily the most specific match). .\"O .PP 一人のユーザに複数のエントリがマッチするときは、順番に適用される。 複数の指定がマッチしている箇所については、最後にマッチしたものが 使用される (それが一番明示的なマッチだとはかぎらないが)。 .PP .\"O The \fIsudoers\fR grammar will be described below in Extended Backus-Naur .\"O Form (\s-1EBNF\s0). Don't despair if you don't know what \s-1EBNF\s0 is; it is .\"O fairly simple, and the definitions below are annotated. 以下では \fIsudoers\fR の文法を拡張 Backus-Naur 記法 (\s-1EBNF\s0) を 使って記述する。\s-1EBNF\s0 がどんなものか知らないからといって、 あきらめないでいただきたい。わりと簡単なものだし、以下に出てくる定義には 詳しい説明を付けておきますから。 .\"O .Sh "Quick guide to \s-1EBNF\s0" .Sh "\s-1EBNF\s0 早わかり" .IX Subsection "Quick guide to EBNF" .\"O \&\s-1EBNF\s0 is a concise and exact way of describing the grammar of a language. .\"O Each \s-1EBNF\s0 definition is made up of \fIproduction rules\fR. E.g., .\"O .PP \&\s-1EBNF\s0 は言語の文法を記述する簡潔で厳密な方法である。 \&\s-1EBNF\s0 の個々の定義は生成規則からできている。たとえば、 .PP .Vb 1 .\"O \& symbol ::= definition | alternate1 | alternate2 ... \& シンボル ::= 定義 | 別の定義 1 | 別の定義 2 ... .Ve .PP .\"O Each \fIproduction rule\fR references others and thus makes up a .\"O grammar for the language. \s-1EBNF\s0 also contains the following .\"O operators, which many readers will recognize from regular .\"O expressions. Do not, however, confuse them with \*(L"wildcard\*(R" .\"O characters, which have different meanings. 個々の生成規則は、ほかの生成規則を参照し、そのようにして言語の文法を 作り上げている。また \s-1EBNF\s0 には以下の演算子が含まれるが、 正規表現で御存じの読者も多いだろう。だが、いわゆる「ワイルドカード」文字と 混同しないでいただきたい。あれは別の意味を持っている。 .ie n .IP "\*(C`?\*(C'" 4 .el .IP "\f(CW\*(C`?\*(C'\fR" 4 .IX Item "?" .\"O Means that the preceding symbol (or group of symbols) is optional. .\"O That is, it may appear once or not at all. 直前のシンボル (または、シンボルのグループ) が、あってもなくてもよいことを 意味する。すなわちそのシンボルは、1 回現れてもよいし、1 回も現れないでもよい。 .ie n .IP "\*(C`*\*(C'" 4 .el .IP "\f(CW\*(C`*\*(C'\fR" 4 .IX Item "*" .\"O Means that the preceding symbol (or group of symbols) may appear .\"O zero or more times. 直前のシンボル (または、シンボルのグループ) が 0 回以上現れる。 .ie n .IP "\*(C`+\*(C'" 4 .el .IP "\f(CW\*(C`+\*(C'\fR" 4 .IX Item "+" .\"O Means that the preceding symbol (or group of symbols) may appear .\"O one or more times. .\"O .PP 直前のシンボル (または、シンボルのグループ) が 1 回以上現れる。 .PP .\"O Parentheses may be used to group symbols together. For clarity, .\"O we will use single quotes ('') to designate what is a verbatim character .\"O string (as opposed to a symbol name). 丸カッコを使うと、複数のシンボルをグループにまとめることができる。 なお混乱を避けるため、以下の定義で (シンボル名ではなく) 文字どおりの 文字列や記号を示す場合は、それをシングルクォート ('') で囲むことにする。 .\"O .Sh "Aliases" .Sh "エイリアス" .IX Subsection "Aliases" .\"O There are four kinds of aliases: \f(CW\*(C`User_Alias\*(C'\fR, \f(CW\*(C`Runas_Alias\*(C'\fR, .\"O \&\f(CW\*(C`Host_Alias\*(C'\fR and \f(CW\*(C`Cmnd_Alias\*(C'\fR. .\"O .PP エイリアスには四種類ある。\f(CW\*(C`User_Alias\*(C'\fR, \&\f(CW\*(C`Runas_Alias\*(C'\fR, \f(CW\*(C`Host_Alias\*(C'\fR, \&\f(CW\*(C`Cmnd_Alias\*(C'\fR である。 .PP .Vb 4 \& Alias ::= \*(AqUser_Alias\*(Aq User_Alias (\*(Aq:\*(Aq User_Alias)* | \& \*(AqRunas_Alias\*(Aq Runas_Alias (\*(Aq:\*(Aq Runas_Alias)* | \& \*(AqHost_Alias\*(Aq Host_Alias (\*(Aq:\*(Aq Host_Alias)* | \& \*(AqCmnd_Alias\*(Aq Cmnd_Alias (\*(Aq:\*(Aq Cmnd_Alias)* \& \& User_Alias ::= NAME \*(Aq=\*(Aq User_List \& \& Runas_Alias ::= NAME \*(Aq=\*(Aq Runas_List \& \& Host_Alias ::= NAME \*(Aq=\*(Aq Host_List \& \& Cmnd_Alias ::= NAME \*(Aq=\*(Aq Cmnd_List \& \& NAME ::= [A\-Z]([A\-Z][0\-9]_)* .Ve .PP .\"O Each \fIalias\fR definition is of the form .\"O .PP 個々のエイリアスの定義は、次の形をとる。 .PP .Vb 1 \& Alias_Type NAME = item1, item2, ... .Ve .PP .\"O where \fIAlias_Type\fR is one of \f(CW\*(C`User_Alias\*(C'\fR, \f(CW\*(C`Runas_Alias\*(C'\fR, \f(CW\*(C`Host_Alias\*(C'\fR, .\"O or \f(CW\*(C`Cmnd_Alias\*(C'\fR. A \f(CW\*(C`NAME\*(C'\fR is a string of uppercase letters, numbers, .\"O and underscore characters ('_'). A \f(CW\*(C`NAME\*(C'\fR \fBmust\fR start with an .\"O uppercase letter. It is possible to put several alias definitions .\"O of the same type on a single line, joined by a colon (':'). E.g., .\"O .PP 上記において、\fIAlias_Type\fR は \f(CW\*(C`User_Alias\*(C'\fR, \&\f(CW\*(C`Runas_Alias\*(C'\fR, \f(CW\*(C`Host_Alias\*(C'\fR, \&\f(CW\*(C`Cmnd_Alias\*(C'\fR のうちの一つである。 \&\f(CW\*(C`NAME\*(C'\fR はアルファベットの大文字、数字、 アンダースコア ('_') からなる文字列であるが、\fB先頭の文字は大文字\fRで なければならない。同じタイプのエイリアス定義を、コロンで (':') つないで、 一行に複数書くこともできる。たとえば、 .PP .Vb 1 \& Alias_Type NAME = item1, item2, item3 : NAME = item4, item5 .Ve .PP .\"O The definitions of what constitutes a valid \fIalias\fR member follow. .\"O .PP 以下では、エイリアスの有効な要素となるものを定義する。 .PP .Vb 2 \& User_List ::= User | \& User \*(Aq,\*(Aq User_List \& \& User ::= \*(Aq!\*(Aq* username | \& \*(Aq!\*(Aq* \*(Aq#\*(Aquid | \& \*(Aq!\*(Aq* \*(Aq%\*(Aqgroup | \& \*(Aq!\*(Aq* \*(Aq+\*(Aqnetgroup | \& \*(Aq!\*(Aq* \*(Aq%:\*(Aqnonunix_group | \& \*(Aq!\*(Aq* User_Alias .Ve .PP .\"O A \f(CW\*(C`User_List\*(C'\fR is made up of one or more usernames, uids (prefixed .\"O with '#'), system groups (prefixed with '%'), netgroups (prefixed .\"O with '+') and \f(CW\*(C`User_Alias\*(C'\fRes. Each list item may be prefixed with .\"O zero or more '!' operators. An odd number of '!' operators negate .\"O the value of the item; an even number just cancel each other out. .\"O .PP \&\f(CW\*(C`User_List\*(C'\fR は一個以上の、ユーザ名、uid ('#' が 頭に付く)、システムグループ名 ('%' が頭に付く) 、ネットグループ名 ('+' が頭に付く)、非 UNIX グループ名 ('%:' が頭に付く)、 \&\f(CW\*(C`User_Alias\*(C'\fR からなる。 リストの各項目の前には一個以上の '!' 演算子を付けてもよい。 奇数個の '!' はその項目の値を否定する。偶数個の場合は互い相殺するだけだ。 .PP .\"O A \f(CW\*(C`username\*(C'\fR, \f(CW\*(C`group\*(C'\fR, \f(CW\*(C`netgroup\*(C'\fR and \f(CW\*(C`nonunix_groups\*(C'\fR may .\"O be enclosed in double quotes to avoid the need for escaping special .\"O characters. Alternately, special characters may be specified in .\"O escaped hex mode, e.g. \ex20 for space. .\"O .PP ユーザ名、グループ名、ネットグループ名、非 UNIX グループ名は、 ダブルクォートで囲めば、特殊文字をエスケープしないですむ。 ダブルクォートで囲まずに特殊文字を使いたいなら、エスケープした 16 進数を 指定してやればよい。たとえば、スペースなら \ex20 という具合だ。 .PP .\"O The \f(CW\*(C`nonunix_group\*(C'\fR syntax depends on the underlying implementation. .\"O For instance, the \s-1QAS\s0 \s-1AD\s0 backend supports the following formats: 非 UNIX グループ名の書式は、利用するサービスの実装によって決まる。たとえば、 \&\s-1Quest Authentication Services\s0 の \s-1AD\s0 バックエンドは、 以下の書式をサポートしている。 .IP "\(bu" 4 .\"O Group in the same domain: \*(L"Group Name\*(R" 同じドメインのグループ: \*(L"Group Name\*(R" .IP "\(bu" 4 .\"O Group in any domain: \*(L"Group Name@FULLY.QUALIFIED.DOMAIN\*(R" 任意のドメインのグループ: \*(L"Group Name@FULLY.QUALIFIED.DOMAIN\*(R" .IP "\(bu" 4 .\"O Group \s-1SID:\s0 \*(L"S\-1\-2\-34\-5678901234\-5678901234\-5678901234\-567\*(R" グループ \s-1SID:\s0 \*(L"S\-1\-2\-34\-5678901234\-5678901234\-5678901234\-567\*(R" .PP .\"O Note that quotes around group names are optional. Unquoted strings must .\"O use a backslash (\e) to escape spaces and the '@' symbol. .\"O .PP グループ名を囲む引用符は任意であることに注意してほしい。文字列を 引用符で囲まない場合は、スペースや '@' 記号をエスケープするために、 バックスラッシュ (\e) を使わなければならない。 .PP .Vb 2 \& Runas_List ::= Runas_Member | \& Runas_Member \*(Aq,\*(Aq Runas_List \& \& Runas_Member ::= \*(Aq!\*(Aq* username | \& \*(Aq!\*(Aq* \*(Aq#\*(Aquid | \& \*(Aq!\*(Aq* \*(Aq%\*(Aqgroup | \& \*(Aq!\*(Aq* +netgroup | \& \*(Aq!\*(Aq* Runas_Alias .Ve .PP .\"O A \f(CW\*(C`Runas_List\*(C'\fR is similar to a \f(CW\*(C`User_List\*(C'\fR except that instead .\"O of \f(CW\*(C`User_Alias\*(C'\fRes it can contain \f(CW\*(C`Runas_Alias\*(C'\fRes. Note that .\"O usernames and groups are matched as strings. In other words, two .\"O users (groups) with the same uid (gid) are considered to be distinct. .\"O If you wish to match all usernames with the same uid (e.g.\ root .\"O and toor), you can use a uid instead (#0 in the example given). .\"O .PP \&\f(CW\*(C`Runas_List\*(C'\fR は \f(CW\*(C`User_List\*(C'\fR に似ている。 違うのは、\f(CW\*(C`User_Alias\*(C'\fR ではなく、 \&\f(CW\*(C`Runas_Alias\*(C'\fR が使えることだ。ユーザ名やグループ名の マッチは文字列として行われることに気を付けてほしい。言い換えると、 二つのユーザ名 (あるいはグループ名) は、かりに同じ uid (gid) を 持っていても、別個のものと見なされるのである。 だから、もし同じ uid を持ったすべてのユーザ名にマッチさせたかったら (たとえば、root と toor がそうだとしよう)、ユーザ名の代わりに uid を 使えばよい (この例なら、#0 である)。 .PP .Vb 2 \& Host_List ::= Host | \& Host \*(Aq,\*(Aq Host_List \& \& Host ::= \*(Aq!\*(Aq* hostname | \& \*(Aq!\*(Aq* ip_addr | \& \*(Aq!\*(Aq* network(/netmask)? | \& \*(Aq!\*(Aq* \*(Aq+\*(Aqnetgroup | \& \*(Aq!\*(Aq* Host_Alias .Ve .PP .\"O A \f(CW\*(C`Host_List\*(C'\fR is made up of one or more hostnames, \s-1IP\s0 addresses, .\"O network numbers, netgroups (prefixed with '+') and other aliases. .\"O Again, the value of an item may be negated with the '!' operator. .\"O If you do not specify a netmask along with the network number, .\"O \&\fBsudo\fR will query each of the local host's network interfaces and, .\"O if the network number corresponds to one of the hosts's network .\"O interfaces, the corresponding netmask will be used. The netmask .\"O may be specified either in standard \s-1IP\s0 address notation .\"O (e.g.\ 255.255.255.0 or ffff:ffff:ffff:ffff::), .\"O or \s-1CIDR\s0 notation (number of bits, e.g.\ 24 or 64). A hostname may .\"O include shell-style wildcards (see the Wildcards section below), .\"O but unless the \f(CW\*(C`hostname\*(C'\fR command on your machine returns the fully .\"O qualified hostname, you'll need to use the \fIfqdn\fR option for .\"O wildcards to be useful. .\"O .PP \&\f(CW\*(C`Host_List\*(C'\fR は一個以上の、ホスト名、\s-1IP\s0 アドレス、 ネットワークアドレス、ネットグループ名 (頭に '+' が付く)、および 他のエイリアスからなる。ここでもまた、'!' 演算子を付けて、項目の値を 否定することができる。ネットワークアドレスにネットマスクを 指定しなかった場合は、\fBsudo\fR がローカルホストの ネットワークインターフェースを一つ一つ参照し、指定された ネットワークアドレスと同じアドレスを持つインターフェースがあれば、 そのネットマスクを使用することになる。ネットマスクの指定は、 標準の \s-1IP\s0 アドレス表記 (たとえば 255.255.255.0 とか ffff:ffff:ffff:ffff:: とか) でもよく、\&\s-1CIDR\s0 表記 (ビット数、 たとえば 24 とか 64 とか) でもよい。ホスト名の一部にシェル風の ワイルドカードを使用することができるが (下記のワイルドカードのセクションを 参照)、使用マシンの \f(CW\*(C`hostname\*(C'\fR コマンドが 完全修飾ドメイン名を返さない場合、ワイルドカードを 利用するには \fIfqdn\fR オプションを使う必要がある。 .PP .Vb 2 \& Cmnd_List ::= Cmnd | \& Cmnd \*(Aq,\*(Aq Cmnd_List \& \& commandname ::= filename | \& filename args | \& filename \*(Aq""\*(Aq \& \& Cmnd ::= \*(Aq!\*(Aq* commandname | \& \*(Aq!\*(Aq* directory | \& \*(Aq!\*(Aq* "sudoedit" | \& \*(Aq!\*(Aq* Cmnd_Alias .Ve .PP .\"O A \f(CW\*(C`Cmnd_List\*(C'\fR is a list of one or more commandnames, directories, and other .\"O aliases. A commandname is a fully qualified filename which may include .\"O shell-style wildcards (see the Wildcards section below). A simple .\"O filename allows the user to run the command with any arguments he/she .\"O wishes. However, you may also specify command line arguments (including .\"O wildcards). Alternately, you can specify \f(CW""\fR to indicate that the command .\"O may only be run \fBwithout\fR command line arguments. A directory is a .\"O fully qualified pathname ending in a '/'. When you specify a directory .\"O in a \f(CW\*(C`Cmnd_List\*(C'\fR, the user will be able to run any file within that directory .\"O (but not in any subdirectories therein). .\"O .PP \&\f(CW\*(C`Cmnd_List\*(C'\fR は一個以上の、コマンド名、ディレクトリ、 他のエイリアスからなるリストである。コマンド名は絶対パスのファイル名で あり、シェル風のワイルドカードを含んでいても構わない (下記のワイルドカードの セクションを参照)。単にファイル名だけ指定した場合、ユーザはお望みの どんな引き数でも付けてそのコマンドを実行することができる。とは言え、 コマンドライン引き数を (ワイルドカードを含めて) 指定しても構わないし、 また、引き数に \f(CW""\fR を指定して、そのコマンドは \&\fBコマンドライン引き数なし\fRの実行のみが可能だと指示することもできる。 ディレクトリは '/' で終わる絶対パス名である。 \&\f(CW\*(C`Cmnd_List\*(C'\fR に ディレクトリを指定すると、ユーザーはそのディレクトリ内の任意のファイルを 実行できるようになる (だが、そのサブディレクトリにあるファイルは実行できない)。 .PP .\"O If a \f(CW\*(C`Cmnd\*(C'\fR has associated command line arguments, then the arguments .\"O in the \f(CW\*(C`Cmnd\*(C'\fR must match exactly those given by the user on the command line .\"O (or match the wildcards if there are any). Note that the following .\"O characters must be escaped with a '\e' if they are used in command .\"O arguments: ',', ':', '=', '\e'. The special command \f(CW"sudoedit"\fR .\"O is used to permit a user to run \fBsudo\fR with the \fB\-e\fR option (or .\"O as \fBsudoedit\fR). It may take command line arguments just as .\"O a normal command does. \&\f(CW\*(C`Cmnd\*(C'\fR がコマンドライン引き数を伴っている場合は、 \&\f(CW\*(C`Cmnd\*(C'\fR 中の引き数は、ユーザがコマンドラインに打ち込む 引き数と正確に一致しなければならない (Cmnd 中の引き数にワイルドカードが あるならば、それがコマンドラインの引き数とマッチしなければならない)。 以下に挙げる文字をコマンド引き数の中で用いるときは、'\e' によって エスケープしなければならないことに注意してほしい。 ',', ':', '=', '\e' が それである。スペシャルコマンド \f(CW"sudoedit"\fR は、ユーザが \&\fBsudo\fR を \fB-e\fR オプション付きで (あるいは、\fBsudoedit\fR という コマンド名で) 実行することを許可するために使用する。この場合、 コマンドライン引き数を取ることができるのは、普通のコマンドとまったく 同様である。 .\"O .Sh "Defaults" .Sh "デフォルトの指定 (Defaults)" .IX Subsection "Defaults" .\"O Certain configuration options may be changed from their default .\"O values at runtime via one or more \f(CW\*(C`Default_Entry\*(C'\fR lines. These .\"O may affect all users on any host, all users on a specific host, a .\"O specific user, a specific command, or commands being run as a specific user. .\"O Note that per-command entries may not include command line arguments. .\"O If you need to specify arguments, define a \f(CW\*(C`Cmnd_Alias\*(C'\fR and reference .\"O that instead. .\"O .PP かなりの設定オプションが、一行以上の \f(CW\*(C`Default_Entry\*(C'\fR 行を 使うことで実行時にデフォルトの値から変更可能だ。その効果の及ぶ範囲は、 任意のホストのすべてのユーザにすることもできるし、ある特定のホストの すべてのユーザ、ある特定のユーザ、ある特定のコマンド、 ある特定のユーザとして実行するコマンドに限定することもできる。 気を付けてほしいのは、コマンドに限定した Defaults 行に コマンドライン引き数まで書くことができないことだ。引き数を指定する必要が ある場合は、\f(CW\*(C`Cmnd_Alias\*(C'\fR を定義して、代わりにそれを 参照すればよい。 .PP .Vb 5 \& Default_Type ::= \*(AqDefaults\*(Aq | \& \*(AqDefaults\*(Aq \*(Aq@\*(Aq Host_List | \& \*(AqDefaults\*(Aq \*(Aq:\*(Aq User_List | \& \*(AqDefaults\*(Aq \*(Aq!\*(Aq Cmnd_List | \& \*(AqDefaults\*(Aq \*(Aq>\*(Aq Runas_List \& \& Default_Entry ::= Default_Type Parameter_List \& \& Parameter_List ::= Parameter | \& Parameter \*(Aq,\*(Aq Parameter_List \& \& Parameter ::= Parameter \*(Aq=\*(Aq Value | \& Parameter \*(Aq+=\*(Aq Value | \& Parameter \*(Aq\-=\*(Aq Value | \& \*(Aq!\*(Aq* Parameter .Ve .PP .\"O Parameters may be \fBflags\fR, \fBinteger\fR values, \fBstrings\fR, or \fBlists\fR. .\"O Flags are implicitly boolean and can be turned off via the '!' .\"O operator. Some integer, string and list parameters may also be .\"O used in a boolean context to disable them. Values may be enclosed .\"O in double quotes (\f(CW\*(C`"\*(C'\fR) when they contain multiple words. Special .\"O characters may be escaped with a backslash (\f(CW\*(C`\e\*(C'\fR). .\"O .PP パラメータは\fBフラグ\fR、\fB整数値\fR、\fB文字列\fR、\fBリスト\fR の どれでもよい。フラグは要するにブーリアン (真偽値) であり、'!' 演算子で off にできる。整数値、文字列、リストのパラメータにも、真偽値として使用して、 それを無効にできるものがいくつか存在する。パラメータの値が複数の単語を 含むときは、値をダブルクオート (\f(CW\*(C`"\*(C'\fR) で囲むとよい。 特殊文字はバックスラッシュ (\f(CW\*(C`\e\*(C'\fR) でエスケープすることが できる。 .PP .\"O Lists have two additional assignment operators, \f(CW\*(C`+=\*(C'\fR and \f(CW\*(C`\-=\*(C'\fR. .\"O These operators are used to add to and delete from a list respectively. .\"O It is not an error to use the \f(CW\*(C`\-=\*(C'\fR operator to remove an element .\"O that does not exist in a list. .\"O .PP リストには代入演算子が \f(CW\*(C`\=\*(C'\fR のほかにもう二つある。 \&\f(CW\*(C`+=\*(C'\fR と \f(CW\*(C`\-=\*(C'\fR である。こうした演算子は それぞれリストに付け加えたり、リストから削除したりするのに使用する。 \&\f(CW\*(C`\-=\*(C'\fR 演算子を使って、リストに存在しない要素を 消去しようとしても、エラーにはならない。 .PP .\"O Defaults entries are parsed in the following order: generic, host .\"O and user Defaults first, then runas Defaults and finally command .\"O defaults. .\"O .PP Defaults 行の解析は、次の順序で行われる。最初に汎用、Host、User の Defaults が解析され、それから Runas、最後にコマンドの Defaults の順番になる。 .PP .\"O See \*(L"\s-1SUDOERS\s0 \s-1OPTIONS\s0\*(R" for a list of supported Defaults parameters. Defaults 行で使用できるパラメータのリストについては、 「SUDOERS のオプション」を御覧いただきたい。 .\"O .Sh "User Specification" .Sh "ユーザの設定 (User Specification)" .IX Subsection "User Specification" .Vb 2 \& User_Spec ::= User_List Host_List \*(Aq=\*(Aq Cmnd_Spec_List \e \& (\*(Aq:\*(Aq Host_List \*(Aq=\*(Aq Cmnd_Spec_List)* \& \& Cmnd_Spec_List ::= Cmnd_Spec | \& Cmnd_Spec \*(Aq,\*(Aq Cmnd_Spec_List \& \& Cmnd_Spec ::= Runas_Spec? Tag_Spec* Cmnd \& \& Runas_Spec ::= \*(Aq(\*(Aq Runas_List? (\*(Aq:\*(Aq Runas_List)? \*(Aq)\*(Aq \& \& Tag_Spec ::= (\*(AqNOPASSWD:\*(Aq | \*(AqPASSWD:\*(Aq | \*(AqNOEXEC:\*(Aq | \*(AqEXEC:\*(Aq | \& \*(AqSETENV:\*(Aq | \*(AqNOSETENV:\*(Aq ) .Ve .PP .\"O A \fBuser specification\fR determines which commands a user may run .\"O (and as what user) on specified hosts. By default, commands are .\"O run as \fBroot\fR, but this can be changed on a per-command basis. .\"O .PP \&\fBユーザの設定\fRは、あるユーザが指定されたホストで (どのユーザに 変身して) どのコマンドを実行できるかを決定する。デフォルトでは、 コマンドは \fBroot\fR に変身して実行されるが、これはコマンドごとに 変更することができる。 .PP .\"O The basic structure of a user specification is `who = where (as_whom) .\"O what'. Let's break that down into its constituent parts: ユーザの設定の基本構造は、「誰が どこで = (誰に変身して) 何を」 である (who where = (as_whom) what)。 構成部分に分けて説明しよう。 .\"O .Sh "Runas_Spec" .Sh "Runas_Spec (どのユーザやグループに変身できるか)" .IX Subsection "Runas_Spec" .\"O A \f(CW\*(C`Runas_Spec\*(C'\fR determines the user and/or the group that a command .\"O may be run as. A fully-specified \f(CW\*(C`Runas_Spec\*(C'\fR consists of two .\"O \&\f(CW\*(C`Runas_List\*(C'\fRs (as defined above) separated by a colon (':') and .\"O enclosed in a set of parentheses. The first \f(CW\*(C`Runas_List\*(C'\fR indicates .\"O which users the command may be run as via \fBsudo\fR's \fB\-u\fR option. .\"O The second defines a list of groups that can be specified via .\"O \&\fBsudo\fR's \fB\-g\fR option. If both \f(CW\*(C`Runas_List\*(C'\fRs are specified, the .\"O command may be run with any combination of users and groups listed .\"O in their respective \f(CW\*(C`Runas_List\*(C'\fRs. If only the first is specified, .\"O the command may be run as any user in the list but no \fB\-g\fR option .\"O may be specified. If the first \f(CW\*(C`Runas_List\*(C'\fR is empty but the .\"O second is specified, the command may be run as the invoking user .\"O with the group set to any listed in the \f(CW\*(C`Runas_List\*(C'\fR. If no .\"O \&\f(CW\*(C`Runas_Spec\*(C'\fR is specified the command may be run as \fBroot\fR and .\"O no group may be specified. .\"O .PP \&\f(CW\*(C`Runas_Spec\*(C'\fR は変身の対象となるユーザやグループを 規定している。完全な形の \f(CW\*(C`Runas_Spec\*(C'\fR は、(上で定義して いるように) コロン (':') で区切られ、カッコで囲まれた、二つの \&\f(CW\*(C`Runas_List\*(C'\fR からなっている。 一つ目の \f(CW\*(C`Runas_List\*(C'\fR は、 \&\fBsudo\fR で \fB\-u\fR オプションを使ったときに変身できるユーザを 指している。二番目の方が規定しているのは、\fBsudo\fR の \fB\-g\fR オプションによって指定できるグループのリストだ。 両方の \f(CW\*(C`Runas_List\*(C'\fR が指定されている場合は、 それぞれの \f(CW\*(C`Runas_List\*(C'\fR にリストされているユーザと グループの任意の組み合わせで、コマンドを実行することが可能である。 一つ目の \f(CW\*(C`Runas_List\*(C'\fR だけが指定されているときは、 リスト中のいかなるユーザにでも変身してコマンドを実行できるが、 \&\fB\-g\fR オプションを指定することはできない。 一つ目の \f(CW\*(C`Runas_List\*(C'\fR が空で、二番目だけ指定されている場合は、 \&\fBsudo\fR を実行するユーザの資格で、グループを \&\f(CW\*(C`Runas_List\*(C'\fR にリストされている任意のグループに設定して、 コマンドを実行することができる。\f(CW\*(C`Runas_Spec\*(C'\fR がまったく 指定されていないときは、 \&\fBroot\fR としてコマンドを実行できるが、グループを指定することはできない。 .PP .\"O A \f(CW\*(C`Runas_Spec\*(C'\fR sets the default for the commands that follow it. .\"O What this means is that for the entry: .\"O .PP \&\f(CW\*(C`Runas_Spec\*(C'\fR は、それに続くコマンドに対してデフォルトを 定める。それはどういうことかと言うと、次のようなエントリがあったとしよう。 .PP .Vb 1 \& dgb boulder = (operator) /bin/ls, /bin/kill, /usr/bin/lprm .Ve .PP .\"O The user \fBdgb\fR may run \fI/bin/ls\fR, \fI/bin/kill\fR, and .\"O \&\fI/usr/bin/lprm\fR \*(-- but only as \fBoperator\fR. E.g., .\"O .PP ユーザ \fBdgb\fR は \fI/bin/ls\fR, \fI/bin/kill\fR, \&\fI/usr/bin/lprm\fR を実行することができる。ただし、\&\fBoperator\fR として実行できるだけだ。たとえば、次のようにである。 .PP .Vb 1 .\"O \& $ sudo \-u operator /bin/ls. \& $ sudo \-u operator /bin/ls .Ve .PP .\"O It is also possible to override a \f(CW\*(C`Runas_Spec\*(C'\fR later on in an .\"O entry. If we modify the entry like so: .\"O .PP エントリの後ろの方の \f(CW\*(C`Runas_Spec\*(C'\fR を変更することも可能だ。 上のエントリをこんなふうに書き変えたとしよう。 .PP .Vb 1 \& dgb boulder = (operator) /bin/ls, (root) /bin/kill, /usr/bin/lprm .Ve .PP .\"O Then user \fBdgb\fR is now allowed to run \fI/bin/ls\fR as \fBoperator\fR, .\"O but \fI/bin/kill\fR and \fI/usr/bin/lprm\fR as \fBroot\fR. .\"O .PP すると、ユーザ \fBdgb\fR は、\fI/bin/ls\fR こそ \fBoperator\fR としてだが、 \&\fI/bin/kill\fR や \fI/usr/bin/lprm\fR は \fBroot\fR の資格で 実行できるようになる。 .PP .\"O We can extend this to allow \fBdgb\fR to run \f(CW\*(C`/bin/ls\*(C'\fR with either .\"O the user or group set to \fBoperator\fR: .\"O .PP \&\fBdgb\fR が \f(CW\*(C`/bin/ls\*(C'\fR を実行するとき、 変身対象ユーザとグループのどちらでも \fBoperator\fR にできるように、 この記述を拡張することもできる。 .PP .Vb 2 \& dgb boulder = (operator : operator) /bin/ls, (root) /bin/kill, \e \& /usr/bin/lprm .Ve .PP .\"O In the following example, user \fBtcm\fR may run commands that access .\"O a modem device file with the dialer group. Note that in this example .\"O only the group will be set, the command still runs as user \fBtcm\fR. .\"O .PP 次の例では、ユーザ \fBtcm\fR が モデムのデバイスファイルにアクセスする コマンドを dialer グループとして実行できるようにしている。 この例では、グループしか指定できないことに注意してほしい。コマンドは ユーザ \fBtcm\fR の資格で実行されるのである。 .PP .Vb 2 \& tcm boulder = (:dialer) /usr/bin/tip, /usr/bin/cu, \e \& /usr/local/bin/minicom .Ve .Sh "Tag_Spec" .IX Subsection "Tag_Spec" .\"O A command may have zero or more tags associated with it. There are .\"O eight possible tag values, \f(CW\*(C`NOPASSWD\*(C'\fR, \f(CW\*(C`PASSWD\*(C'\fR, \f(CW\*(C`NOEXEC\*(C'\fR, \f(CW\*(C`EXEC\*(C'\fR, .\"O \&\f(CW\*(C`SETENV\*(C'\fR and \f(CW\*(C`NOSETENV\*(C'\fR. .\"O Once a tag is set on a \f(CW\*(C`Cmnd\*(C'\fR, subsequent \f(CW\*(C`Cmnd\*(C'\fRs in the .\"O \&\f(CW\*(C`Cmnd_Spec_List\*(C'\fR, inherit the tag unless it is overridden by the .\"O opposite tag (i.e.: \f(CW\*(C`PASSWD\*(C'\fR overrides \f(CW\*(C`NOPASSWD\*(C'\fR and \f(CW\*(C`NOEXEC\*(C'\fR .\"O overrides \f(CW\*(C`EXEC\*(C'\fR). .\"O .PP コマンドは 0 個以上のタグを伴うことができる。タグの値としては、 \&\f(CW\*(C`NOPASSWD\*(C'\fR, \f(CW\*(C`PASSWD\*(C'\fR, \&\f(CW\*(C`NOEXEC\*(C'\fR, \f(CW\*(C`EXEC\*(C'\fR, \&\f(CW\*(C`SETENV\*(C'\fR, \f(CW\*(C`NOSETENV\*(C'\fR の六つが可能で ある。ある \f(CW\*(C`Cmnd\*(C'\fR にタグをセットすると、 \&\f(CW\*(C`Cmnd_Spec_List\*(C'\fR 中のそれ以後の \&\f(CW\*(C`Cmnd\*(C'\fR は、反対の意味を持つタグによって変更されないかぎり、 そのタグを継承する (すなわち、\f(CW\*(C`PASSWD\*(C'\fR は \&\f(CW\*(C`NOPASSWD\*(C'\fR を上書きし、\f(CW\*(C`NOEXEC\*(C'\fR は \&\f(CW\*(C`EXEC\*(C'\fR を上書きするわけだ)。 .PP .\"O \fI\s-1NOPASSWD\s0 and \s-1PASSWD\s0\fR \fI\s-1NOPASSWD\s0 と \s-1PASSWD\s0\fR .IX Subsection "NOPASSWD and PASSWD" .PP .\"O By default, \fBsudo\fR requires that a user authenticate him or herself .\"O before running a command. This behavior can be modified via the .\"O \&\f(CW\*(C`NOPASSWD\*(C'\fR tag. Like a \f(CW\*(C`Runas_Spec\*(C'\fR, the \f(CW\*(C`NOPASSWD\*(C'\fR tag sets .\"O a default for the commands that follow it in the \f(CW\*(C`Cmnd_Spec_List\*(C'\fR. .\"O Conversely, the \f(CW\*(C`PASSWD\*(C'\fR tag can be used to reverse things. .\"O For example: .\"O .PP デフォルトでは、\fBsudo\fR はコマンドを実行する前に、 ユーザが本人であることを証明するように求める。この振舞いは \&\f(CW\*(C`NOPASSWD\*(C'\fR タグによって変更することができる。 \&\f(CW\*(C`Runas_Spec\*(C'\fR と同様、\f(CW\*(C`NOPASSWD\*(C'\fR タグも \&\f(CW\*(C`Cmnd_Spec_List\*(C'\fR 中のそれに続くコマンドに対して デフォルトを定める。\f(CW\*(C`PASSWD\*(C'\fR の働きは反対であり、 振舞いを元に戻したいときに使える。たとえば、 .PP .Vb 1 \& ray rushmore = NOPASSWD: /bin/kill, /bin/ls, /usr/bin/lprm .Ve .PP .\"O would allow the user \fBray\fR to run \fI/bin/kill\fR, \fI/bin/ls\fR, and .\"O \&\fI/usr/bin/lprm\fR as \fBroot\fR on the machine rushmore without .\"O authenticating himself. If we only want \fBray\fR to be able to .\"O run \fI/bin/kill\fR without a password the entry would be: .\"O .PP とすれば、ユーザ \fBray\fR はマシン rushmore 上で認証をしないでも \&\fBroot\fR として \fI/bin/kill\fR, \fI/bin/ls\fR, \&\fI/usr/bin/lprm\fR を実行できるようになる。もし \fBray\fR が パスワードなしで実行できるコマンドを \fI/bin/kill\fR だけに 絞りたいのなら、エントリはこうなるだろう。 .PP .Vb 1 \& ray rushmore = NOPASSWD: /bin/kill, PASSWD: /bin/ls, /usr/bin/lprm .Ve .PP .\"O Note, however, that the \f(CW\*(C`PASSWD\*(C'\fR tag has no effect on users who are .\"O in the group specified by the \fIexempt_group\fR option. .\"O .PP ただし、ユーザが \fIexempt_group\fR オプションで指定されているグループに 属する場合は、\f(CW\*(C`PASSWD\*(C'\fR タグが効果を持たないことに 注意してほしい。 .PP .\"O By default, if the \f(CW\*(C`NOPASSWD\*(C'\fR tag is applied to any of the entries .\"O for a user on the current host, he or she will be able to run .\"O \&\f(CW\*(C`sudo \-l\*(C'\fR without a password. Additionally, a user may only run .\"O \&\f(CW\*(C`sudo \-v\*(C'\fR without a password if the \f(CW\*(C`NOPASSWD\*(C'\fR tag is present .\"O for all a user's entries that pertain to the current host. .\"O This behavior may be overridden via the verifypw and listpw options. .\"O .PP デフォルトでは、現在使用中のホストに関するユーザのエントリのうちに \&\f(CW\*(C`NOPASSWD\*(C'\fR タグが指定されているものが一つでもあれば、 そのユーザはパスワードなしで \f(CW\*(C`sudo \-l\*(C'\fR を実行できる。 なお、ユーザがパスワードなしで \f(CW\*(C`sudo \-v\*(C'\fR を実行できるのは、 現在使用中のホストに関するそのユーザのエントリのすべてで \&\f(CW\*(C`NOPASSWD\*(C'\fR タグが生きているときのみである。この動作は、 \&\fIverifypw\fR や \fIlistpw\fR オプションによって変更できる。 .PP .\"O \fI\s-1NOEXEC\s0 and \s-1EXEC\s0\fR \fI\s-1NOEXEC\s0 と \s-1EXEC\s0\fR .IX Subsection "NOEXEC and EXEC" .PP .\"O If \fBsudo\fR has been compiled with \fInoexec\fR support and the underlying .\"O operating system supports it, the \f(CW\*(C`NOEXEC\*(C'\fR tag can be used to prevent .\"O a dynamically-linked executable from running further commands itself. .\"O .PP \&\fBsudo\fR が \fInoexec\fR サポートつきでコンパイルされ、 下で稼働しているオペレーティングシステムがそれに対応している場合、 \&\f(CW\*(C`NOEXEC\*(C'\fR タグを利用すれば、動的にリンクされた実行ファイルが そこからさらにコマンドを実行するのを防ぐことができる。 .PP .\"O In the following example, user \fBaaron\fR may run \fI/usr/bin/more\fR .\"O and \fI/usr/bin/vi\fR but shell escapes will be disabled. .\"O .PP 次の例では、ユーザ \fBaaron\fR は \fI/usr/bin/more\fR と \&\fI/usr/bin/vi\fR を実行できるが、シェル・エスケープは利用できない。 .PP .Vb 1 \& aaron shanty = NOEXEC: /usr/bin/more, /usr/bin/vi .Ve .PP .\"O See the \*(L"\s-1PREVENTING\s0 \s-1SHELL\s0 \s-1ESCAPES\s0\*(R" section below for more details .\"O on how \f(CW\*(C`NOEXEC\*(C'\fR works and whether or not it will work on your system. .\"O .PP \&\f(CW\*(C`NOEXEC\*(C'\fR がどんなふうに働くのか、お使いのシステムで 利用できるかどうか、などについてさらに詳しく知りたかったら、 「シェル・エスケープを防止する」のセクションを御覧になっていただきたい。 .PP .\"O \fI\s-1SETENV\s0 and \s-1NOSETENV\s0\fR \fI\s-1SETENV\s0 と \s-1NOSETENV\s0\fR .IX Subsection "SETENV and NOSETENV" .PP .\"O These tags override the value of the \fIsetenv\fR option on a per-command .\"O basis. Note that if \f(CW\*(C`SETENV\*(C'\fR has been set for a command, any .\"O environment variables set on the command line way are not subject .\"O to the restrictions imposed by \fIenv_check\fR, \fIenv_delete\fR, or .\"O \&\fIenv_keep\fR. As such, only trusted users should be allowed to set .\"O variables in this manner. If the command matched is \fB\s-1ALL\s0\fR, the .\"O \&\f(CW\*(C`SETENV\*(C'\fR tag is implied for that command; this default may .\"O be overridden by use of the \f(CW\*(C`UNSETENV\*(C'\fR tag. 上記のタグは \fIsetenv\fR オプションの値をコマンドごとに変更する。 注意すべきは、あるコマンドに対して \f(CW\*(C`SETENV\*(C'\fR が 設定されていると、コマンドラインから設定するどんな環境変数も \fIenv_check\fR, \&\fIenv_delete\fR, \fIenv_keep\fR による規制を受けないということである。 だから、そうした形で環境変数を設定することを許可するのは、 信用できるユーザだけに限るべきだ。なお、マッチするコマンドが \&\fB\s-1ALL\s0\fR だった場合は、暗黙のうちに \f(CW\*(C`SETENV\*(C'\fR タグが そのコマンドに付けられるが、このデフォルトの動作は \&\f(CW\*(C`UNSETENV\*(C'\fR タグを使えば打ち消すことができる。 .\"O .Sh "Wildcards" .Sh "ワイルドカード" .IX Subsection "Wildcards" .\"O \&\fBsudo\fR allows shell-style \fIwildcards\fR (aka meta or glob characters) .\"O to be used in hostnames, pathnames and command line arguments in .\"O the \fIsudoers\fR file. Wildcard matching is done via the \fB\s-1POSIX\s0\fR .\"O \&\fIglob\fR\|(3) and \fIfnmatch\fR\|(3) routines. Note that these are \fInot\fR .\"O regular expressions. \&\fIsudoers\fR ファイルでは、ホスト名、コマンドラインのパス名、 コマンドラインの引き数にシェル形式のワイルドカード (メタ文字とか glob キャラクタとも言う) が使用できる。ワイルドカードのマッチングは \&\fB\s-1POSIX\s0\fR の \fIglob\fR\|(3) と \fIfnmatch\fR\|(3) ルーティンを用いて行われる。\fB以下のものは正規表現ではない\fRことに 注意してほしい。 .ie n .IP "\*(C`*\*(C'" 8 .el .IP "\f(CW\*(C`*\*(C'\fR" 8 .IX Item "*" .\"O Matches any set of zero or more characters. ゼロ個以上の任意の文字にマッチする。 .ie n .IP "\*(C`?\*(C'" 8 .el .IP "\f(CW\*(C`?\*(C'\fR" 8 .IX Item "?" .\"O Matches any single character. 任意の一文字にマッチする。 .ie n .IP "\*(C`[...]\*(C'" 8 .el .IP "\f(CW\*(C`[...]\*(C'\fR" 8 .IX Item "[...]" .\"O Matches any character in the specified range. 指定された範囲の任意の一文字にマッチする。 .ie n .IP "\*(C`[!...]\*(C'" 8 .el .IP "\f(CW\*(C`[!...]\*(C'\fR" 8 .IX Item "[!...]" .\"O Matches any character \fBnot\fR in the specified range. 指定された範囲\fB以外\fRの任意の一文字にマッチする。 .ie n .IP "\*(C`\ex\*(C'" 8 .el .IP "\f(CW\*(C`\ex\*(C'\fR" 8 .IX Item "x" .\"O For any character \*(L"x\*(R", evaluates to \*(L"x\*(R". This is used to .\"O escape special characters such as: \*(L"*\*(R", \*(L"?\*(R", \*(L"[\*(R", and \*(L"}\*(R". .\"O .PP \&\*(L"x\*(R" がどんな文字であっても、\*(L"x\*(R" そのものとして 評価する。これは \*(L"*\*(R", \*(L"?\*(R", \*(L"[\*(R", \*(L"}\*(R" といった 特殊文字をエスケープするために使用する。 .PP .\"O \&\s-1POSIX\s0 character classes may also be used if your system's \fIglob\fR\|(3) .\"O and \fIfnmatch\fR\|(3) functions support them. However, because the .\"O \&\f(CW\*(Aq:\*(Aq\fR character has special meaning in \fIsudoers\fR, it must be .\"O escaped. For example: .\"O .PP 使用システムの \fIglob\fR\|(3) や \fIfnmatch\fR\|(3) 関数が \&\s-1POSIX\s0 の文字クラスに対応しているなら、文字クラスも使用できる。 ただし、\f(CW\*(Aq:\*(Aq\fR 文字は、\fIsudoers\fR で特別な意味を 持っているので、エスケープしなければならない。一例を上げると、 .PP .Vb 1 \& /bin/ls [[\e:alpha\e:]]* .Ve .PP .\"O Would match any filename beginning with a letter. .\"O .PP 上記は、文字で始まるどんなファイル名にもマッチするだろう。 .PP .\"O Note that a forward slash ('/') will \fBnot\fR be matched by .\"O wildcards used in the pathname. When matching the command .\"O line arguments, however, a slash \fBdoes\fR get matched by .\"O wildcards. This is to make a path like: .\"O .PP コマンドのパス名に使われたワイルドカードはフォワードスラッシュ ('/') に\fBマッチしない\fRことに注意してほしい。だが、コマンドライン引き数との マッチングでは、ワイルドカードはスラッシュと\fBしっかりマッチする\fR。 そこで、 .PP .Vb 1 \& /usr/bin/* .Ve .PP .\"O match \fI/usr/bin/who\fR but not \fI/usr/bin/X11/xterm\fR. というコマンドパスは、\fI/usr/bin/who\fR とマッチするが、 \&\fI/usr/bin/X11/xterm\fR とはマッチしないことになる。 .\"O .Sh "Exceptions to wildcard rules" .Sh "ワイルドカード・ルールの例外" .IX Subsection "Exceptions to wildcard rules" .\"O The following exceptions apply to the above rules: 上記ルールには次の例外がある。 .ie n .IP """""" 8 .el .IP "\f(CW``''\fR" 8 .IX Item """""" .\"O If the empty string \f(CW""\fR is the only command line argument in the .\"O \&\fIsudoers\fR entry it means that command is not allowed to be run .\"O with \fBany\fR arguments. \&\fIsudoers\fR ファイルのエントリにおいて、空文字列 \f(CW""\fR が唯一 のコマンドライン引き数だった場合は、そのコマンドに\fBいかなる\fR引き数を付 けて実行することも許されないということである。 .\"O .Sh "Including other files from within sudoers" .Sh "sudoers に他のファイルをインクルードする" .IX Subsection "Including other files from within sudoers" .\"O It is possible to include other \fIsudoers\fR files from within the .\"O \&\fIsudoers\fR file currently being parsed using the \f(CW\*(C`#include\*(C'\fR and .\"O \&\f(CW\*(C`#includedir\*(C'\fR directives. .\"O .PP \&\f(CW\*(C`#include\*(C'\fR 命令や \f(CW\*(C`#includedir\*(C'\fR 命令を 使えば、現在解析中の \fIsudoers\fR ファイルに外部にあるほかの \&\fIsudoers\fR ファイルをインクルードすることができる。 .PP .\"O This can be used, for example, to keep a site-wide \fIsudoers\fR file .\"O in addition to a local, per-machine file. For the sake of this .\"O example the site-wide \fIsudoers\fR will be \fI/etc/sudoers\fR and the .\"O per-machine one will be \fI/etc/sudoers.local\fR. To include .\"O \&\fI/etc/sudoers.local\fR from within \fI/etc/sudoers\fR we would use the .\"O following line in \fI/etc/sudoers\fR: この方法を使えば、たとえば、サイト全体で使用する \fIsudoers\fR ファイルの ほかに、マシンごとのローカルな \fIsudoers\fR ファイルを持つことができる。 ここでは、サイト全体の \fIsudoers\fR を \fI/etc/sudoers\fR とし、 マシンごとの方は \fI/etc/sudoers.local\fR とすることにしよう。 \&\fI/etc/sudoers\fR に \fI/etc/sudoers.local\fR をインクルードするには、 \&\fI/etc/sudoers\fR 中に次の行を書き込む。 .Sp .RS 4 \&\f(CW\*(C`#include /etc/sudoers.local\*(C'\fR .RE .PP .\"O When \fBsudo\fR reaches this line it will suspend processing of the .\"O current file (\fI/etc/sudoers\fR) and switch to \fI/etc/sudoers.local\fR. .\"O Upon reaching the end of \fI/etc/sudoers.local\fR, the rest of .\"O \&\fI/etc/sudoers\fR will be processed. Files that are included may .\"O themselves include other files. A hard limit of 128 nested include .\"O files is enforced to prevent include file loops. .\"O .PP \&\fBsudo\fR は解析中この行に出会うと、カレントファイル (\fI/etc/sudoers\fR だ) の処理を一時中止し、処理の対象を \&\fI/etc/sudoers.local\fR に切り替える。そして、 \&\fI/etc/sudoers.local\fR の末尾まで達したら、\fI/etc/sudoers\fR の 残りを処理するのだ。インクルードされたファイルがさらに他のファイルを インクルードしてもよい。インクルートのネストには 128 ファイルまでという ハード・リミットがあって、インクルードファイルのループが起きないように なっている。 .PP .\"O The filename may include the \f(CW%h\fR escape, signifying the short form .\"O of the hostname. I.e., if the machine's hostname is \*(L"xerxes\*(R", then .\"O .PP ファイル名には \f(CW%h\fR エスケープが使える。これはホスト名の短縮形を 示している。たとえば、マシンのホスト名が \*(L"xerxes\*(R" のとき、 .PP \&\f(CW\*(C`#include /etc/sudoers.%h\*(C'\fR .PP .\"O will cause \fBsudo\fR to include the file \fI/etc/sudoers.xerxes\fR. .\"O .PP と書けば、\fBsudo\fR はファイル \fI/etc/sudoers.xerxes\fR をインクルード することになる。 .PP .\"O The \f(CW\*(C`#includedir\*(C'\fR directive can be used to create a \fIsudo.d\fR .\"O directory that the system package manager can drop \fIsudoers\fR rules .\"O into as part of package installation. For example, given: .\"O .PP \&\f(CW\*(C`#includedir\*(C'\fR 命令を使えば、\fIsudo.d\fR ディレクトリを 作っておいて、システムのパッケージ管理者がパッケージをインストールする過程で \&\fIsudoers\fR のルールを記したファイルをそこに入れてやる、といったことが 可能になる。たとえば、次のように書くと、 .PP \&\f(CW\*(C`#includedir /etc/sudoers.d\*(C'\fR .PP .\"O \&\fBsudo\fR will read each file in \fI/etc/sudoers.d\fR, skipping file .\"O names that end in \f(CW\*(C`~\*(C'\fR or contain a \f(CW\*(C`.\*(C'\fR character to avoid causing .\"O problems with package manager or editor temporary/backup files. .\"O Files are parsed in sorted lexical order. That is, .\"O \&\fI/etc/sudoers.d/01_first\fR will be parsed before .\"O \&\fI/etc/sudoers.d/10_second\fR. Be aware that because the sorting is .\"O lexical, not numeric, \fI/etc/sudoers.d/1_whoops\fR would be loaded .\"O \&\fBafter\fR \fI/etc/sudoers.d/10_second\fR. Using a consistent number .\"O of leading zeroes in the file names can be used to avoid such .\"O problems. .\"O .PP \&\fBsudo\fR は \fI/etc/sudoers.d\fR にあるファイルを一つづつ読み込む。 ただし、末尾が \f(CW\*(C`~\*(C'\fR だったり、\f(CW\*(C`.\*(C'\fR 文字を 含んでいたりするファイル名はスキップするが、これは パッケージマネージャや エディタが作った、テンポラリファイルやバックアップファイルを読み込むような 問題を起こさないためである。ファイルは辞書順にソートされて、解析される。 すなわち、\fI/etc/sudoers.d/01_first\fR が \fI/etc/sudoers.d/10_second\fR より前に解析されるということだ。ソートは辞書順であって、数値の順では ないので、\fI/etc/sudoers.d/1_whoops\fR というファイルがあっても、 \&\fI/etc/sudoers.d/10_second\fR \fBより後で\fRロードされることに 注意してほしい。ファイル名の先頭を 0 で埋めて数字の桁を揃えれば、 こうした問題を回避することができる。 .PP .\"O Note that unlike files included via \f(CW\*(C`#include\*(C'\fR, \fBvisudo\fR will not .\"O edit the files in a \f(CW\*(C`#includedir\*(C'\fR directory unless one of them .\"O contains a syntax error. It is still possible to run \fBvisudo\fR .\"O with the \f(CW\*(C`\-f\*(C'\fR flag to edit the files directly. 気を付けてほしいが、\f(CW\*(C`#include\*(C'\fR でインクルードされた ファイルとは違って (訳注: \fBvisudo\fR は \fI/etc/sudoers\fR を 編集するとき、\f(CW\*(C`#include\*(C'\fR で指定したファイルがあれば、 続けてそれも編集する)、 \&\fBvisudo\fR が \f(CW\*(C`#includedir\*(C'\fR で指定したディレクトリの ファイルまで編集するのは、シンタクスエラーを含むものがあるときだけである。 とは言え、\fBvisudo\fR を \f(CW\*(C`\-f\*(C'\fR オプション付きで実行して、 ディレクトリ中のファイルを直接編集することは可能だ。 .\"O .Sh "Other special characters and reserved words" .Sh "ほかの特殊文字と予約語" .IX Subsection "Other special characters and reserved words" .\"O The pound sign ('#') is used to indicate a comment (unless it is .\"O part of a #include directive or unless it occurs in the context of .\"O a user name and is followed by one or more digits, in which case .\"O it is treated as a uid). Both the comment character and any text .\"O after it, up to the end of the line, are ignored. .\"O .PP パウンド記号 ('#') はコメントを示すのに使用される (例外は、#include 命令の 一部であるときや、ユーザ名に関連して現れ、その後に一個以上の数字が 続くときであり、後者の場合は uid と見なされる)。コメント記号と それに続くテキストは、行末にいたるまで無視される。 .PP .\"O The reserved word \fB\s-1ALL\s0\fR is a built-in \fIalias\fR that always causes .\"O a match to succeed. It can be used wherever one might otherwise .\"O use a \f(CW\*(C`Cmnd_Alias\*(C'\fR, \f(CW\*(C`User_Alias\*(C'\fR, \f(CW\*(C`Runas_Alias\*(C'\fR, or \f(CW\*(C`Host_Alias\*(C'\fR. .\"O You should not try to define your own \fIalias\fR called \fB\s-1ALL\s0\fR as the .\"O built-in alias will be used in preference to your own. Please note .\"O that using \fB\s-1ALL\s0\fR can be dangerous since in a command context, it .\"O allows the user to run \fBany\fR command on the system. .\"O .PP 予約語 \fB\s-1ALL\s0\fR は組込みのエイリアスであり、何に対してでも マッチする。\fB\s-1ALL\s0\fR は、\f(CW\*(C`Cmnd_Alias\*(C'\fR, \&\f(CW\*(C`User_Alias\*(C'\fR, \f(CW\*(C`Runas_Alias\*(C'\fR, \&\f(CW\*(C`Host_Alias\*(C'\fR を代わりに使えるところなら、どこでも 使用できる。\fB\s-1ALL\s0\fR という名前のエイリアスを自分で定義しようと してはいけない。組込みのエイリアスの方が、自分で作ったエイリアスより 優先して使われるからだ。\fB\s-1ALL\s0\fR の使用には危険が伴うことが あるのを忘れないでいただきたい。なぜなら、\fB\s-1ALL\s0\fR を コマンドに関して使うと、ユーザにシステム上の\fBどんな\fRコマンドでも 実行することを許してしまうからである。 .PP .\"O An exclamation point ('!') can be used as a logical \fInot\fR operator .\"O both in an \fIalias\fR and in front of a \f(CW\*(C`Cmnd\*(C'\fR. This allows one to .\"O exclude certain values. Note, however, that using a \f(CW\*(C`!\*(C'\fR in .\"O conjunction with the built-in \f(CW\*(C`ALL\*(C'\fR alias to allow a user to .\"O run \*(L"all but a few\*(R" commands rarely works as intended (see \s-1SECURITY\s0 .\"O \&\s-1NOTES\s0 below). .\"O .PP エクスクラメーションマーク ('!') は、エイリアスでも \&\f(CW\*(C`Cmnd\*(C'\fR の前でも論理 \fInot\fR 演算子として使用できる。 これによってある値を除外することが可能だ。しかしながら、 組込みエイリアス \f(CW\*(C`ALL\*(C'\fR と \f(CW\*(C`!\*(C'\fR を 組み合わせて、「二三のコマンド以外のすべての」コマンドの実行をあるユーザに 許可しようとしても、思いどおりの動きになることはめったにないことに 気を付けてほしい (下記の「セキュリティに関する注意点」を参照)。 .PP .\"O Long lines can be continued with a backslash ('\e') as the last .\"O character on the line. .\"O .PP 長い行は、行末にバックスラッシュ ('\e') を置けば、継続することができる。 .PP .\"O Whitespace between elements in a list as well as special syntactic .\"O characters in a \fIUser Specification\fR ('=', ':', '(', ')') is optional. .\"O .PP リストにおける要素間やユーザ設定における構文用特殊文字 ('=', ':', '(', ')') の前後に空白文字 (whitespace)を入れることは、 任意である。 .PP .\"O The following characters must be escaped with a backslash ('\e') when .\"O used as part of a word (e.g.\ a username or hostname): .\"O \&'@', '!', '=', ':', ',', '(', ')', '\e'. 次の文字を単語 (ユーザ名とかホスト名とか) の一部として使うときは、 バックスラッシュ ('\e') でエスケープしなければならない。 \&'@', '!', '=', ':', ',', '(', ')', '\e' がそれである。 .\"O .SH "SUDOERS OPTIONS" .SH "SUDOERS のオプション" .IX Header "SUDOERS OPTIONS" .\"O \&\fBsudo\fR's behavior can be modified by \f(CW\*(C`Default_Entry\*(C'\fR lines, as .\"O explained earlier. A list of all supported Defaults parameters, .\"O grouped by type, are listed below. .\"O .PP すでに説明したように、\fBsudo\fR の動作は \&\f(CW\*(C`Default_Entry\*(C'\fR 行によって変更することができる。 Defaults に与えることのできるパラメータについて、サポートされているも ののすべてを、タイプ別にまとめて以下に列挙する。 .PP .\"O \&\fBFlags\fR: \&\fBフラグ\fR: .IP "always_set_home" 16 .IX Item "always_set_home" .\"O If set, \fBsudo\fR will set the \f(CW\*(C`HOME\*(C'\fR environment variable to the home .\"O directory of the target user (which is root unless the \fB\-u\fR option is used). .\"O This effectively means that the \fB\-H\fR option is always implied. .\"O This flag is \fIoff\fR by default. これをセットすると、\fBsudo\fR は環境変数 \f(CW\*(C`HOME\*(C'\fR を 変身対象ユーザのホームディレクトリに設定する (\fB\-u\fR オプションが 使用されないかぎり、それは root である)。事実上、暗黙のうちに \fBsudo\fR に \&\fB\-H\fR オプションが常に指定されることになるわけだ。このフラグは デフォルトでは \fIoff\fR である。 .IP "authenticate" 16 .IX Item "authenticate" .\"O If set, users must authenticate themselves via a password (or other .\"O means of authentication) before they may run commands. This default .\"O may be overridden via the \f(CW\*(C`PASSWD\*(C'\fR and \f(CW\*(C`NOPASSWD\*(C'\fR tags. .\"O This flag is \fIon\fR by default. これをセットすると、ユーザはコマンドの実行を許可される前に、パスワードで (あるいは、ほかの認証方法で) 認証をしなければならない。このデフォルト値は \&\f(CW\*(C`PASSWD\*(C'\fR や \f(CW\*(C`NOPASSWD\*(C'\fR タグで変更できる。 このフラグはデフォルトでは \fIon\fR である。 .IP "closefrom_override" 16 .IX Item "closefrom_override" .\"O If set, the user may use \fBsudo\fR's \fB\-C\fR option which .\"O overrides the default starting point at which \fBsudo\fR begins .\"O closing open file descriptors. This flag is \fIoff\fR by default. これをセットすると、ユーザが \fBsudo\fR の \fB\-C\fR オプションを 使用できるようになる。\fB\-C\fR オプションというのは、\fBsudo\fR が 開いたファイルを閉じていくとき、どのファイル・ディスクリプタから クローズしていくかというデフォルトの始点を変更するものだ。このフラグは デフォルトでは \fIoff\fR である。 .IP "env_editor" 16 .IX Item "env_editor" .\"O If set, \fBvisudo\fR will use the value of the \s-1EDITOR\s0 or \s-1VISUAL\s0 .\"O environment variables before falling back on the default editor list. .\"O Note that this may create a security hole as it allows the user to .\"O run any arbitrary command as root without logging. A safer alternative .\"O is to place a colon-separated list of editors in the \f(CW\*(C`editor\*(C'\fR .\"O variable. \fBvisudo\fR will then only use the \s-1EDITOR\s0 or \s-1VISUAL\s0 if .\"O they match a value specified in \f(CW\*(C`editor\*(C'\fR. This flag is \fIoff\fR by .\"O default. これをセットすると、\fBvisudo\fR はデフォルトのエディタ・リストを 利用する前に、環境変数 \s-1EDITOR\s0 や \s-1VISUAL\s0 の値を 使用するようになる。これがセキュリティホールになりかねないことに 注意してほしい。ユーザが root として任意のコマンドをログに記録されることなく 実行できるようになるからだ。こうした環境変数を利用するときの、 \&\fIenv_editor\fR を有効にするよりも安全な方法は、 \&\fIsudoers\fR ファイルの \f(CW\*(C`editor\*(C'\fR オプションに コロンで区切ったエディタのリストを書いておくことだ。そうすれば、 \&\fBvisudo\fR が \s-1EDITOR\s0 や \s-1VISUAL\s0 を使うのは、 それが \f(CW\*(C`editor\*(C'\fR オプションに指定した値とマッチしたときだけに なる。このフラグはデフォルトでは \fIoff\fR である。 .IP "env_reset" 16 .IX Item "env_reset" .\"O If set, \fBsudo\fR will reset the environment to only contain the .\"O \&\s-1LOGNAME\s0, \s-1SHELL\s0, \s-1USER\s0, \s-1USERNAME\s0 and the \f(CW\*(C`SUDO_*\*(C'\fR variables. Any .\"O variables in the caller's environment that match the \f(CW\*(C`env_keep\*(C'\fR .\"O and \f(CW\*(C`env_check\*(C'\fR lists are then added. The default contents of the .\"O \&\f(CW\*(C`env_keep\*(C'\fR and \f(CW\*(C`env_check\*(C'\fR lists are displayed when \fBsudo\fR is .\"O run by root with the \fI\-V\fR option. If the \fIsecure_path\fR option .\"O is set, its value will be used for the \f(CW\*(C`PATH\*(C'\fR environment variable. .\"O This flag is \fIon\fR by default. これをセットすると、\fBsudo\fR は環境を以下の変数のみを含むように 設定し直す。すなわち、\s-1LOGNAME\s0, \s-1SHELL\s0, \s-1USER\s0, \&\s-1USERNAME\s0 それに \f(CW\*(C`SUDO_*\*(C'\fR である。その後で さらに、\fBsudo\fR を起動するユーザの環境にある変数のうち、 \&\f(CW\*(C`env_keep\*(C'\fR や \f(CW\*(C`env_check\*(C'\fR のリストに マッチするものが追加される。 \f(CW\*(C`env_keep\*(C'\fR や \&\f(CW\*(C`env_check\*(C'\fR のリストにデフォルトでどんな変数が 含まれているかは、root ユーザが \fBsudo\fR を \fI\-V\fR オプション付きで 実行すれば、見ることができる。なお、\fIsudoers\fR ファイルの \&\fIsecure_path\fR オプションが設定されているときは、その値が 環境変数 \f(CW\*(C`PATH\*(C'\fR として使用されることになる。 このフラグはデフォルトでは \fIon\fR である。 .IP "fqdn" 16 .IX Item "fqdn" .\"O Set this flag if you want to put fully qualified hostnames in the .\"O \&\fIsudoers\fR file. I.e., instead of myhost you would use myhost.mydomain.edu. .\"O You may still use the short form if you wish (and even mix the two). .\"O Beware that turning on \fIfqdn\fR requires \fBsudo\fR to make \s-1DNS\s0 lookups .\"O which may make \fBsudo\fR unusable if \s-1DNS\s0 stops working (for example .\"O if the machine is not plugged into the network). Also note that .\"O you must use the host's official name as \s-1DNS\s0 knows it. That is, .\"O you may not use a host alias (\f(CW\*(C`CNAME\*(C'\fR entry) due to performance .\"O issues and the fact that there is no way to get all aliases from .\"O \&\s-1DNS\s0. If your machine's hostname (as returned by the \f(CW\*(C`hostname\*(C'\fR .\"O command) is already fully qualified you shouldn't need to set .\"O \&\fIfqdn\fR. This flag is \fIoff\fR by default. \&\fIsudoers\fR ファイルで完全修飾ホスト名を使用したかったら、 このフラグをセットするとよい。すなわち、myhost ではなく、 myhost.mydomain.edu を使いたい場合だ。そのときでも、そうしたければ、 短縮形も使える (両方を混ぜて使うことだってできる)。気を付けて ほしいのは、\fIfqdn\fR を 有効にすると、\fBsudo\fR は \s-1DNS\s0 へ 問い合わせをしなければならないので、\s-1DNS\s0 サービスが 稼働していない場合、\fBsudo\fR が使えなくなるかもしれないということだ (たとえば、マシンがネットワークに接続していない場合)。 もう一つ気を付けるべきことがある。 \&\s-1DNS\s0 が知っているホストの正式名を使わなければならないということだ。 言い換えれば、ホストのエイリアス (\f(CW\*(C`CNAME\*(C'\fR のエントリ) を 使ってはいけない。パフォーマンスの問題もあるし、\s-1DNS\s0 からエイリアスを すべて取得する方法はないからでもある。マシンのホスト名が \&(\f(CW\*(C`hostname\*(C'\fR コマンドで返ってくるものが) すでに 完全修飾名になっているならば、\fIfqdn\fR をセットする必要はないだろう。 このフラグはデフォルトでは \fIoff\fR である。 .IP "ignore_dot" 16 .IX Item "ignore_dot" .\"O If set, \fBsudo\fR will ignore '.' or '' (current dir) in the \f(CW\*(C`PATH\*(C'\fR .\"O environment variable; the \f(CW\*(C`PATH\*(C'\fR itself is not modified. This .\"O flag is \fIoff\fR by default. これをセットすると、環境変数 \f(CW\*(C`PATH\*(C'\fR 中に '.' や '' (カレントディレクトリ) があっても、\fBsudo\fR はそれを無視する。 \&\f(CW\*(C`PATH\*(C'\fR そのものは変更されない。このフラグは デフォルトでは \fIoff\fR である。 .IP "ignore_local_sudoers" 16 .IX Item "ignore_local_sudoers" .\"O If set via \s-1LDAP\s0, parsing of \fI/etc/sudoers\fR will be skipped. .\"O This is intended for Enterprises that wish to prevent the usage of local .\"O sudoers files so that only \s-1LDAP\s0 is used. This thwarts the efforts of .\"O rogue operators who would attempt to add roles to \fI/etc/sudoers\fR. .\"O When this option is present, \fI/etc/sudoers\fR does not even need to .\"O exist. Since this option tells \fBsudo\fR how to behave when no specific \s-1LDAP\s0 .\"O entries have been matched, this sudoOption is only meaningful for the .\"O \&\f(CW\*(C`cn=defaults\*(C'\fR section. This flag is \fIoff\fR by default. \&\s-1LDAP\s0 の方でこのフラグをセットすると、\fI/etc/sudoers\fR の 解析がスキップされる。このフラグは、ローカルにある sudoers ファイルの 使用を禁じて、\s-1LDAP\s0 のみを使うようにしたい企業のためにある。 たちの悪いオペレータが \fI/etc/sudoers\fR に手を加えて自分の権限を 増やそうとしても、そうした悪だくみは阻止されるわけだ。このオプションが 設定されているときは、\fI/etc/sudoers\fR ファイルは存在する必要すらない。 このオプションは、マッチする \s-1LDAP\s0 の具体的なエントリが 一つもなかったときに、どう振舞うべきかを \fBsudo\fR に指示するものだから、 これを指定した sudoOption は \f(CW\*(C`cn=defaults\*(C'\fR のセクションに なければ意味がない。このフラグはデフォルトでは \fIoff\fR である。 .IP "insults" 16 .IX Item "insults" .\"O If set, \fBsudo\fR will insult users when they enter an incorrect .\"O password. This flag is \fIoff\fR by default. これをセットすると、不正なパスワードが入力されたとき、 \&\fBsudo\fR がユーザに悪態をつく。このフラグはデフォルトでは \fIoff\fR である。 .IP "log_host" 16 .IX Item "log_host" .\"O If set, the hostname will be logged in the (non-syslog) \fBsudo\fR log file. .\"O This flag is \fIoff\fR by default. これをセットすると、ホスト名が (syslog 経由ではない) \fBsudo\fR の ログファイルに記録されることになる。このフラグはデフォルトでは \fIoff\fR である。 .IP "log_year" 16 .IX Item "log_year" .\"O If set, the four-digit year will be logged in the (non-syslog) \fBsudo\fR log file. .\"O This flag is \fIoff\fR by default. これをセットすると、四桁の年が (syslog 経由ではない) \fBsudo\fR の ログファイルに記入されることになる。このフラグはデフォルトでは \fIoff\fR である。 .IP "long_otp_prompt" 16 .IX Item "long_otp_prompt" .\"O When validating with a One Time Password (\s-1OPT\s0) scheme such as .\"O \&\fBS/Key\fR or \fB\s-1OPIE\s0\fR, a two-line prompt is used to make it easier .\"O to cut and paste the challenge to a local window. It's not as .\"O pretty as the default but some people find it more convenient. This .\"O flag is \fIoff\fR by default. \&\fBS/Key\fR や \fB\s-1OPIE\s0\fR のような One Time Password (\s-1OTP\s0) スキームを採用しているときにこれを有効にすると、チャレンジを ローカルウィンドウにカット・アンド・ペーストしやすいように、 二行のプロンプトが使用される。デフォルトのプロンプトほど見栄えはよくないが、 こちらの方が便利だと思う人もいる。デフォルトではこのフラグは \fIoff\fR である。 .IP "mail_always" 16 .IX Item "mail_always" .\"O Send mail to the \fImailto\fR user every time a users runs \fBsudo\fR. .\"O This flag is \fIoff\fR by default. ユーザが \fBsudo\fR を実行するたびに、\fImailto\fR ユーザにメールを送る。 このフラグはデフォルトでは \fIoff\fR である。 .IP "mail_badpass" 16 .IX Item "mail_badpass" .\"O Send mail to the \fImailto\fR user if the user running \fBsudo\fR does not .\"O enter the correct password. This flag is \fIoff\fR by default. \&\fBsudo\fR を実行するユーザが正しいパスワードを入力しないと、 \&\fImailto\fR ユーザにメールを送る。このフラグはデフォルトでは \&\fIoff\fR である。 .IP "mail_no_host" 16 .IX Item "mail_no_host" .\"O If set, mail will be sent to the \fImailto\fR user if the invoking .\"O user exists in the \fIsudoers\fR file, but is not allowed to run .\"O commands on the current host. This flag is \fIoff\fR by default. これをセットすると、\fBsudo\fR を起動したユーザが \fIsudoers\fR ファイルに 存在するものの、使用中のホストでコマンドの実行を許可されていない場合、 \&\fImailto\fR ユーザにメールを送付する。このフラグはデフォルトでは \&\fIoff\fR である。 .IP "mail_no_perms" 16 .IX Item "mail_no_perms" .\"O If set, mail will be sent to the \fImailto\fR user if the invoking .\"O user is allowed to use \fBsudo\fR but the command they are trying is not .\"O listed in their \fIsudoers\fR file entry or is explicitly denied. .\"O This flag is \fIoff\fR by default. これをセットすると、\fBsudo\fR を起動したユーザが \fBsudo\fR の使用を 許可されているが、実行しようとしているコマンドが \fIsudoers\fR ファイルの そのユーザのエントリに登録されていないか、明示的に禁止されている場合、 \&\fImailto\fR ユーザにメールを送付する。このフラグはデフォルトでは \&\fIoff\fR である。 .IP "mail_no_user" 16 .IX Item "mail_no_user" .\"O If set, mail will be sent to the \fImailto\fR user if the invoking .\"O user is not in the \fIsudoers\fR file. This flag is \fIon\fR .\"O by default. これをセットすると、\fBsudo\fR を起動したユーザが \fIsudoers\fR ファイルに 記載されていない場合、\fImailto\fR ユーザにメールを送付する。 このフラグはデフォルトでは \fIon\fR である。 .IP "noexec" 16 .IX Item "noexec" .\"O If set, all commands run via \fBsudo\fR will behave as if the \f(CW\*(C`NOEXEC\*(C'\fR .\"O tag has been set, unless overridden by a \f(CW\*(C`EXEC\*(C'\fR tag. See the .\"O description of \fI\s-1NOEXEC\s0 and \s-1EXEC\s0\fR below as well as the \*(L"\s-1PREVENTING\s0 \s-1SHELL\s0 .\"O \&\s-1ESCAPES\s0\*(R" section at the end of this manual. This flag is \fIoff\fR by default. これをセットすると、\fBsudo\fR を通して実行されるすべてのコマンドが、 \&\f(CW\*(C`EXEC\*(C'\fR タグで無効にされないかぎり、あたかも \&\f(CW\*(C`NOEXEC\*(C'\fR タグが設定されているかのごとく振舞うようになる。 上述の「\fI\s-1NOEXEC\s0 と \s-1EXEC\s0\fR」の説明、および、このマニュアルの 終わりの方にある「シェル・エスケープを防止する」というセクションを 参照してほしい。このフラグはデフォルトでは \fIoff\fR である。 .IP "path_info" 16 .IX Item "path_info" .\"O Normally, \fBsudo\fR will tell the user when a command could not be .\"O found in their \f(CW\*(C`PATH\*(C'\fR environment variable. Some sites may wish .\"O to disable this as it could be used to gather information on the .\"O location of executables that the normal user does not have access .\"O to. The disadvantage is that if the executable is simply not in .\"O the user's \f(CW\*(C`PATH\*(C'\fR, \fBsudo\fR will tell the user that they are not .\"O allowed to run it, which can be confusing. This flag is \fIon\fR .\"O by default. 通常 \fBsudo\fR は、環境変数 \f(CW\*(C`PATH\*(C'\fR 中にコマンドが 見付からないと、ユーザにそのことを知らせる。これを利用すれば、 一般ユーザにアクセス権のない実行ファイルのありかについて情報を 収集できるという理由から、この動作を無効にしたいサイトもあるかもしれない。 その場合の欠点は、実行ファイルが単にユーザの \f(CW\*(C`PATH\*(C'\fR 中に なかっただけの場合でも、実行の許可がないと \fBsudo\fR がユーザに告げる ことになって、実情がわかりにくいかもしれないことである。このフラグは デフォルトでは \fIon\fR である。 .IP "passprompt_override" 16 .IX Item "passprompt_override" .\"O The password prompt specified by \fIpassprompt\fR will normally only .\"O be used if the passwod prompt provided by systems such as \s-1PAM\s0 matches .\"O the string \*(L"Password:\*(R". If \fIpassprompt_override\fR is set, \fIpassprompt\fR .\"O will always be used. This flag is \fIoff\fR by default. 通常、\fIpassprompt\fR オプションによって指定されたパスワードプロンプトが 使用されるのは、\s-1PAM\s0 のようなシステムが用意している パスワードプロンプトが \*(L"Password:\*(R" という文字列にマッチしている ときだけである。\fIpassprompt_override\fR をセットすると、 \&\fIpassprompt\fR が無条件で使われることになる。このフラグは デフォルトでは \fIoff\fR である。 .IP "preserve_groups" 16 .IX Item "preserve_groups" .\"O By default, \fBsudo\fR will initialize the group vector to the list of .\"O groups the target user is in. When \fIpreserve_groups\fR is set, the .\"O user's existing group vector is left unaltered. The real and .\"O effective group IDs, however, are still set to match the target .\"O user. This flag is \fIoff\fR by default. デフォルトでは、\fBsudo\fR は所属グループの初期値として、変身対象ユーザが 所属しているグループのリストを設定する。 \fIpreserve_groups\fR を セットすると、\fBsudo\fR を実行するユーザの所属グループのリストが、 変更されずにそのまま維持される。とは言え、実グループ ID や 実効グループ ID が変身対象ユーザのそれに設定されることに変わりはない。 このフラグはデフォルトでは \fIoff\fR である。 .IP "pwfeedback" 16 .IX Item "pwfeedback" .\"O By default, \fBsudo\fR reads the password like most other Unix programs, .\"O by turning off echo until the user hits the return (or enter) key. .\"O Some users become confused by this as it appears to them that \fBsudo\fR .\"O has hung at this point. When \fIpwfeedback\fR is set, \fBsudo\fR will .\"O provide visual feedback when the user presses a key. Note that .\"O this does have a security impact as an onlooker may be able to .\"O determine the length of the password being entered. .\"O This flag is \fIoff\fR by default. ほかのたいていの Unix プログラムと同様、\fBsudo\fR はパスワードを 読み込むとき、デフォルトでは、ユーザが Return (または Enter) キーを 押すまで、エコーを off にする。この動作にとまどうユーザが存在する。 彼らには \fBsudo\fR が急に反応しなくなったように見えるのだ。 \&\fIpwfeedback\fR をセットすると、ユーザがキーを押すたびに、\fBsudo\fR が 目に見える反応を返すようになる。これには、セキュリティ上の問題が あることに注意してほしい。横で見ている人が、打ち込まれたパスワードの 文字数を特定することができるかもしれないのだ。このフラグはデフォルトでは \&\fIoff\fR である。 .IP "requiretty" 16 .IX Item "requiretty" .\"O If set, \fBsudo\fR will only run when the user is logged in to a real .\"O tty. When this flag is set, \fBsudo\fR can only be run from a login .\"O session and not via other means such as \fIcron\fR\|(8) or cgi-bin scripts. .\"O This flag is \fIoff\fR by default. これをセットすると、\fBsudo\fR が実行されるのは、ユーザが実際の tty に ログインしたときだけになる。すなわち、\fBsudo\fR を実行できるのは、 ログイン・セッションからだけであって、 \&\fIcron\fR\|(8) や cgi-bin スクリプトといった、ほかの方法を介して実行する ことはできないということだ。このフラグは、デフォルトでは \fIoff\fR である。 .IP "root_sudo" 16 .IX Item "root_sudo" .\"O If set, root is allowed to run \fBsudo\fR too. Disabling this prevents users .\"O from \*(L"chaining\*(R" \fBsudo\fR commands to get a root shell by doing something .\"O like \f(CW"sudo sudo /bin/sh"\fR. Note, however, that turning off \fIroot_sudo\fR .\"O will also prevent root and from running \fBsudoedit\fR. .\"O Disabling \fIroot_sudo\fR provides no real additional security; it .\"O exists purely for historical reasons. .\"O This flag is \fIon\fR by default. これをセットすると、root も \fBsudo\fR を実行できるようになる。 このフラグを無効にすると、ユーザがたとえば \f(CW"sudo sudo /bin/sh"\fR と いったように \fBsudo\fR コマンドを\fB連鎖的に\fR使って、ルートシェルを 獲得することができなくなる。ところで、 \&\fIroot_sudo\fR が off だと、root が \fBsudoedit\fR まで実行できなくなる ことに注意してほしい。 \&\fIroot_sudo\fR を無効にしても、セキュリティが実際に向上するわけではない。 このフラグが存在しているのは、もっぱら歴史的な理由からなのだ。 このフラグはデフォルトでは \fIon\fR である。 .IP "rootpw" 16 .IX Item "rootpw" .\"O If set, \fBsudo\fR will prompt for the root password instead of the password .\"O of the invoking user. This flag is \fIoff\fR by default. これをセットすると、\fBsudo\fR はプロンプトで、起動したユーザの パスワードではなく、root のパスワードを要求するようになる。 このフラグはデフォルトでは \fIoff\fR である。 .IP "runaspw" 16 .IX Item "runaspw" .\"O If set, \fBsudo\fR will prompt for the password of the user defined by the .\"O \&\fIrunas_default\fR option (defaults to \f(CW\*(C`root\*(C'\fR) instead of the .\"O password of the invoking user. This flag is \fIoff\fR by default. これをセットすると、\fBsudo\fR はプロンプトで、起動したユーザの パスワードではなく、\fIsudoers\fR ファイルの \fIrunas_default\fR オプションが 定義しているユーザーの (デフォルトでは \f(CW\*(C`root\*(C'\fR である) パスワードを要求する。このフラグはデフォルトでは \fIoff\fR である。 .IP "set_home" 16 .IX Item "set_home" .\"O If set and \fBsudo\fR is invoked with the \fB\-s\fR option the \f(CW\*(C`HOME\*(C'\fR .\"O environment variable will be set to the home directory of the target .\"O user (which is root unless the \fB\-u\fR option is used). This effectively .\"O makes the \fB\-s\fR option imply \fB\-H\fR. This flag is \fIoff\fR by default. これがセットされているとき、\fBsudo\fR を \fB\-s\fR オプション付きで 起動すると、環境変数 \f(CW\*(C`HOME\*(C'\fR が変身対象ユーザの (\fB\-u\fR オプションが使用されないかぎり、それは root である) ホームディレクトリに設定される。すなわち、 \fB\-s\fR オプションが \&\fB\-H\fR オプションを事実上兼ねることになるわけだ。このフラグは デフォルトでは \fIoff\fR である。 .IP "set_logname" 16 .IX Item "set_logname" .\"O Normally, \fBsudo\fR will set the \f(CW\*(C`LOGNAME\*(C'\fR, \f(CW\*(C`USER\*(C'\fR and \f(CW\*(C`USERNAME\*(C'\fR .\"O environment variables to the name of the target user (usually root .\"O unless the \fB\-u\fR option is given). However, since some programs .\"O (including the \s-1RCS\s0 revision control system) use \f(CW\*(C`LOGNAME\*(C'\fR to .\"O determine the real identity of the user, it may be desirable to .\"O change this behavior. This can be done by negating the set_logname .\"O option. Note that if the \fIenv_reset\fR option has not been disabled, .\"O entries in the \fIenv_keep\fR list will override the value of .\"O \&\fIset_logname\fR. This flag is \fIoff\fR by default. 通常 \fBsudo\fR は環境変数 \f(CW\*(C`LOGNAME\*(C'\fR, \&\f(CW\*(C`USER\*(C'\fR, \f(CW\*(C`USERNAME\*(C'\fR を 変身対象ユーザの名前 (\fB-u\fR オプションが指定されていない場合、 普通は root) にセットする。しかし、プログラムによっては (たとえば、 \&\s-1RCS\s0 リビジョンコントロールシステムがその一つだが) ユーザが 実際には誰であるかを判定するのに \f(CW\*(C`LOGNAME\*(C'\fR を 使用していることがあるので、この振舞いを変更することが望ましい場合もある。 set_logname オプションに '!' を付けて否定することで、それができる。 なお \fIenv_reset\fR オプションを無効にしていない場合、 \&\fIenv_keep\fR リストの項目が \fIset_logname\fR による値を 上書きすることになるので、注意してほしい。このフラグはデフォルトでは \&\fIon\fR である。 .IP "setenv" 16 .IX Item "setenv" .\"O Allow the user to disable the \fIenv_reset\fR option from the command .\"O line. Additionally, environment variables set via the command line .\"O are not subject to the restrictions imposed by \fIenv_check\fR, .\"O \&\fIenv_delete\fR, or \fIenv_keep\fR. As such, only trusted users should .\"O be allowed to set variables in this manner. This flag is \fIoff\fR .\"O by default. これをセットすると、ユーザがコマンドラインから \fIenv_reset\fR オプションを 無効にできるようになる。さらに、コマンドラインから設定する環境変数が \&\fIenv_check\fR, \fIenv_delete\fR, \fIenv_keep\fR による制限を 受けなくなる。それ故、そのようなやり方で変数を設定することを 許可するのは、信用できるユーザのみに限るべきだ。このフラグは デフォルトでは \fIoff\fR である。 .IP "shell_noargs" 16 .IX Item "shell_noargs" .\"O If set and \fBsudo\fR is invoked with no arguments it acts as if the .\"O \&\fB\-s\fR option had been given. That is, it runs a shell as root (the .\"O shell is determined by the \f(CW\*(C`SHELL\*(C'\fR environment variable if it is .\"O set, falling back on the shell listed in the invoking user's .\"O /etc/passwd entry if not). This flag is \fIoff\fR by default. これがセットされているとき、\fBsudo\fR を引き数なしで起動すると、 \&\fBsudo\fR は \fB\-s\fR オプションが指定されたかのように振舞う。 すなわち、root ユーザとしてシェルを実行するわけだ (シェルは、 環境変数 \f(CW\*(C`SHELL\*(C'\fR がセットされていれば、それによって決まるし、 セットされていなければ、\fBsudo\fR を起動したユーザの /etc/passwd エントリに 登録されたものになる)。このフラグはデフォルトでは \fIoff\fR である。 .IP "fast_glob" 16 .IX Item "fast_glob" .\"O Normally, \fBsudo\fR uses the \fIglob\fR\|(3) function to do shell-style .\"O globbing when matching pathnames. However, since it accesses the .\"O file system, \fIglob\fR\|(3) can take a long time to complete for some .\"O patterns, especially when the pattern references a network file .\"O system that is mounted on demand (automounted). The \fIfast_glob\fR .\"O option causes \fBsudo\fR to use the \fIfnmatch\fR\|(3) function, which does .\"O not access the file system to do its matching. The disadvantage .\"O of \fIfast_glob\fR is that it is unable to match relative pathnames .\"O such as \fI./ls\fR or \fI../bin/ls\fR. This flag is \fIoff\fR by default. 通常 \fBsudo\fR はパス名のマッチングをするとき、\fIglob\fR\|(3) 関数を 使用して、シェル・スタイルのワイルドカード展開 (glob) を行う。しかし、 \&\fIglob\fR\|(3) はファイルシステムにアクセスするので、指定パターンに よっては、作業を完了するまでに時間がかかることがある。 必要な時にマウントするようになっている (つまりオートマウントの) ネットワーク・ファイル・システムを参照するときは、とりわけ時間がかかる。 \&\fIfast_glob\fR オプションを指定すると、\fBsudo\fR が \&\fIfnmatch\fR\|(3) 関数を使うようになるが、こちらの関数はマッチングの際に ファイルシステムにアクセスしない。\fIfast_glob\fR の欠点は、 \&\fI./ls\fR や \fI../bin/ls\fR のような相対パスに対するマッチが できないことである。このフラグはデフォルトでは \fIoff\fR である。 .IP "stay_setuid" 16 .IX Item "stay_setuid" .\"O Normally, when \fBsudo\fR executes a command the real and effective .\"O UIDs are set to the target user (root by default). This option .\"O changes that behavior such that the real \s-1UID\s0 is left as the invoking .\"O user's \s-1UID\s0. In other words, this makes \fBsudo\fR act as a setuid .\"O wrapper. This can be useful on systems that disable some potentially .\"O dangerous functionality when a program is run setuid. This option .\"O is only effective on systems with either the \fIsetreuid()\fR or \fIsetresuid()\fR .\"O function. This flag is \fIoff\fR by default. 通常 \fBsudo\fR がコマンドを実行するとき、実 UID と実効 UID は 変身対象ユーザ (デフォルトでは root) のものにセットされる。このオプションは その振舞いを変更して、\fBsudo\fR を起動したユーザの \s-1UID\s0 が、 そのまま実 \s-1UID\s0 として残るようにする。言い換えると、\fBsudo\fR が setuid ラッパーとして動作するようになるわけだ。プログラムを setuid で 動かすと、危険をもたらしかねないという理由から、ある種の機能を 使えないようにしているシステムでは、このオプションが役に立つかもしれない。 このオプションは、 \fIsetreuid()\fR 関数なり \fIsetresuid()\fR 関数なりを 持っているシステムでのみ有効である。 このフラグはデフォルトでは \fIoff\fR である。 .IP "targetpw" 16 .IX Item "targetpw" .\"O If set, \fBsudo\fR will prompt for the password of the user specified by .\"O the \fB\-u\fR option (defaults to \f(CW\*(C`root\*(C'\fR) instead of the password of the .\"O invoking user. Note that this precludes the use of a uid not listed .\"O in the passwd database as an argument to the \fB\-u\fR option. .\"O This flag is \fIoff\fR by default. これをセットすると、\fBsudo\fR はプロンプトで、起動したユーザのパスワード ではなく、\fB\-u\fR オプションで指定されたユーザ (デフォルトでは root) の パスワードを要求する。この設定をすると、\fB\-u\fR オプションの引き数として、 passwd データベースに登録されていない uid が使えなくなることに注意してほしい。 このフラグはデフォルトでは \fIoff\fR である。 .IP "tty_tickets" 16 .IX Item "tty_tickets" .\"O If set, users must authenticate on a per-tty basis. Normally, .\"O \&\fBsudo\fR uses a directory in the ticket dir with the same name as .\"O the user running it. With this flag enabled, \fBsudo\fR will use a .\"O file named for the tty the user is logged in on in that directory. .\"O This flag is \fIoff\fR by default. これをセットすると、ユーザは tty ごとに認証をしなければならなくなる。 \&\fBsudo\fR は通常、チケットディレクトリ (訳注:たとえば /var/run/sudo) にある、\fBsudo\fR を実行しているユーザと同じ名前のディ レクトリを認証に使用する。しかし、このフラグが有効になっている場合は、 そのディレクトリにある、ユーザがログインしている tty に対応する名前の ファイルを使用することになるのだ。このフラグはデフォルトでは \fIoff\fR である。 .IP "umask_override" 16 .IX Item "umask_override" .\"O If set, \fBsudo\fR will set the umask as specified by \fIsudoers\fR without .\"O modification. This makes it possible to specify a more permissive .\"O umask in \fIsudoers\fR than the user's own umask and matches historical .\"O behavior. If \fIumask_override\fR is not set, \fBsudo\fR will set the .\"O umask to be the union of the user's umask and what is specified in .\"O \&\fIsudoers\fR. This flag is \fIoff\fR by default. これをセットすると、\fBsudo\fR は umask を \fIsudoers\fR の umask オプションで指定されたとおりの値に、変更を加えることなく設定する。 このことによって、ユーザ自身の umask 値よりもっと緩やかな umask 値を \&\fIsudoers\fR で指定することが可能になる。\fBsudo\fR の昔の動作と 同じになるわけだ。 \&\fIumask_override\fR をセットしない場合、現在の \fBsudo\fR は umask を、 ユーザの umask 値と \fIsudoers\fR で指定した umask 値とのビット和に 設定することになっている。このフラグはデフォルトでは \fIoff\fR である。 .\" .IP "use_loginclass" 16 .\" .IX Item "use_loginclass" .\" If set, \fBsudo\fR will apply the defaults specified for the target user's .\" login class if one exists. Only available if \fBsudo\fR is configured with .\" the \-\-with\-logincap option. This flag is \fIoff\fR by default. .\" これをセットすると、\fBsudo\fR は、変身対象ユーザのログインクラスが存 .\" 在するならば、それに対して指定されたデフォルトの値を使うことになる。こ .\" のフラグは、\fBsudo\fR を \-\-with\-logincap オプションを付けて .\" configure したときのみ利用することができる。このフラグはデフォルトでは .\" \&\fIoff\fR である。 .IP "visiblepw" 16 .IX Item "visiblepw" .\"O By default, \fBsudo\fR will refuse to run if the user must enter a .\"O password but it is not possible to disable echo on the terminal. .\"O If the \fIvisiblepw\fR flag is set, \fBsudo\fR will prompt for a password .\"O even when it would be visible on the screen. This makes it possible .\"O to run things like \f(CW"rsh somehost sudo ls"\fR since \fIrsh\fR\|(1) does .\"O not allocate a tty. This flag is \fIoff\fR by default. .\"O .PP デフォルトでは、ユーザがパスワードを入力しなければならないときに、 使用しているターミナルでエコーの抑制ができなかったら、 \&\fBsudo\fR は実行を拒否するようになっている。これに対し、 \&\fIvisiblepw\fR フラグが設定されていると、パスワードがスクリーンに 表示されてしまう場合でも、\fBsudo\fR はプロンプトを出して、パスワードを 求める。この動作によって、 \&\fIrsh\fR\|(1) は tty を割り当てないにもかかわらず、 \&\f(CW"rsh somehost sudo ls"\fR といった操作の実行が可能になるわけだ。 このフラグはデフォルトでは \fIoff\fR である。 .PP .\"O \&\fBIntegers\fR: \&\fB整数\fR: .IP "closefrom" 16 .IX Item "closefrom" .\"O Before it executes a command, \fBsudo\fR will close all open file .\"O descriptors other than standard input, standard output and standard .\"O error (ie: file descriptors 0\-2). The \fIclosefrom\fR option can be used .\"O to specify a different file descriptor at which to start closing. .\"O The default is \f(CW3\fR. \&\fBsudo\fR はコマンドを実行する前に、標準入力、標準出力、標準エラー (すなわち、ファイルディスクリプタ 0\-2 である) を除いて、 オープンしたすべてのファイル・ディスクリプタをクローズする。 \&\fIclosefrom\fR オプションを使用すると、0\-2 以外の どのファイル・ディスクリプタからクローズして行くかを指定することができる。 デフォルトは \f(CW3\fR である。 .IP "passwd_tries" 16 .IX Item "passwd_tries" .\"O The number of tries a user gets to enter his/her password before .\"O \&\fBsudo\fR logs the failure and exits. The default is \f(CW\*(C`3\*(C'\fR. .\"O .PP \&\fBsudo\fR が「失敗」をログに記録して終了する前に、ユーザがパスワードを 入力できる回数。デフォルトは \f(CW\*(C`3\*(C'\fR。 .PP .\"O \&\fBIntegers that can be used in a boolean context\fR: \&\fB真偽値としても使用できる整数\fR: .IP "loglinelen" 16 .IX Item "loglinelen" .\"O Number of characters per line for the file log. This value is used .\"O to decide when to wrap lines for nicer log files. This has no .\"O effect on the syslog log file, only the file log. The default is .\"O \&\f(CW\*(C`80\*(C'\fR (use 0 or negate the option to disable word wrap). \&\fBsudo\fR 用ログファイルの一行あたりの文字数。この値は、ログファイルを 見やすくするために改行する位置を決めるのに使用される。この値は、 syslog 経由のログファイルには影響せず、直接ファイルにログを書き出すときのみ 効果がある。デフォルトは \f(CW\*(C`80\*(C'\fR である (改行をしないように するには、値を 0 にするか、頭に '!' を付けて、このオプションを否定する)。 .IP "passwd_timeout" 16 .IX Item "passwd_timeout" .\"O Number of minutes before the \fBsudo\fR password prompt times out. .\"O The default is \f(CW\*(C`5\*(C'\fR; set this to \f(CW0\fR for no password timeout. \&\fBsudo\fR のパスワードプロンプトが時間切れになるまでの分単位の時間。 デフォルトは \f(CW\*(C`5\*(C'\fR である。これを \f(CW0\fR にセットする と、パスワードプロンプトが時間切れなしになる。 .IP "timestamp_timeout" 16 .IX Item "timestamp_timeout" .\"O Number of minutes that can elapse before \fBsudo\fR will ask for a .\"O passwd again. The default is \f(CW\*(C`5\*(C'\fR. Set this to \f(CW0\fR to always .\"O prompt for a password. .\"O If set to a value less than \f(CW0\fR the user's timestamp will never .\"O expire. This can be used to allow users to create or delete their .\"O own timestamps via \f(CW\*(C`sudo \-v\*(C'\fR and \f(CW\*(C`sudo \-k\*(C'\fR respectively. \&\fBsudo\fR がパスワードを再び要求するようになるまでの時間を分単位で 指定する。デフォルトでは \f(CW\*(C`5\*(C'\fR である。これを \f(CW0\fR に セットすると、毎回パスワードを要求するようになる。\f(CW0\fR より小さい値に セットした場合は、ユーザのタイムスタンプが期限切れになることがない。 ユーザが \f(CW\*(C`sudo \-v\*(C'\fR と \f(CW\*(C`sudo \-k\*(C'\fR を 実行することによって、タイムスタンプを自分で作ったり、消したりできるように したかったら、この手を使えばよい。 .IP "umask" 16 .IX Item "umask" .\"O Umask to use when running the command. Negate this option or set .\"O it to 0777 to preserve the user's umask. The actual umask that is .\"O used will be the union of the user's umask and \f(CW\*(C`0022\*(C'\fR. .\"O This guarantees that \fBsudo\fR never lowers the umask when running a .\"O command. Note on systems that use \s-1PAM\s0, the default \s-1PAM\s0 configuration .\"O may specify its own umask which will override the value set in .\"O \&\fIsudoers\fR. .\"O .PP コマンドを実行しているときに使用する umask 値。ユーザの umask 値をそのまま 使いたかったら、'!' を頭に付けて、このオプションを否定するか、0777 に セットする。このオプションの値が 0777 以外の場合、実際に使用される umask 値は、ユーザの umask 値と umask オプションで指定する umask 値との ビット和になる。そのことによって、\fBsudo\fR がコマンドを実行するときの umask 値が、ユーザの umask 値より低くならないようになっているわけだ。 なお、umask オプションのデフォルトの値は、\f(CW\*(C`0022\*(C'\fR である。 \&\s-1PAM\s0 を使用しているシステムでは、 \s-1PAM\s0 のデフォルト設定で umask 値を指定することができるが、その場合は、それが \fIsudoers\fR で 指定した値を上書きすることに注意してほしい。 .PP .\"O \&\fBStrings\fR: \&\fB文字列\fR: .IP "badpass_message" 16 .IX Item "badpass_message" .\"O Message that is displayed if a user enters an incorrect password. .\"O The default is \f(CW\*(C`Sorry, try again.\*(C'\fR unless insults are enabled. ユーザが不正なパスワードを入力したときに表示するメッセージ。 \&\fIinsults\fR フラグが有効になっていないかぎり、デフォルトは 「\f(CW\*(C`Sorry, try again.\*(C'\fR」である。 .IP "editor" 16 .IX Item "editor" .\"O A colon (':') separated list of editors allowed to be used with .\"O \&\fBvisudo\fR. \fBvisudo\fR will choose the editor that matches the user's .\"O \&\s-1EDITOR\s0 environment variable if possible, or the first editor in the .\"O list that exists and is executable. The default is the path to vi .\"O on your system. \&\fBvisudo\fR で使用できるエディタをコロン (':') で区切ったリスト。 \&\fBvisudo\fR は、可能ならば、ユーザの \s-1EDITOR\s0 環境変数と一致し たエディタを選択する。それができないときは、このリストにあるエディタで、 実際に存在し、かつ実行可能な最初のエディタを使用する。デフォルトは使用 システムにおける vi のパスである。 .IP "mailsub" 16 .IX Item "mailsub" .\"O Subject of the mail sent to the \fImailto\fR user. The escape \f(CW%h\fR .\"O will expand to the hostname of the machine. .\"O Default is \f(CW\*(C`*** SECURITY information for %h ***\*(C'\fR. \&\fImailto\fR ユーザに送付するメールの件名。エスケープ文字 \f(CW%h\fR はマシンのホスト名に展開される。デフォルトは「\f(CW\*(C`*** SECURITY information for %h ***\*(C'\fR」。 .IP "noexec_file" 16 .IX Item "noexec_file" .\"O Path to a shared library containing dummy versions of the \fIexecv()\fR, .\"O \&\fIexecve()\fR and \fIfexecve()\fR library functions that just return an error. .\"O This is used to implement the \fInoexec\fR functionality on systems that .\"O support \f(CW\*(C`LD_PRELOAD\*(C'\fR or its equivalent. Defaults to \fI/usr/local/libexec/sudo_noexec.so\fR. ライブラリ関数 \fIexecv()\fR, \&\fIexecve()\fR, \fIfexecve()\fR の ダミー版 (エラーを返すだけの関数) が入っている共有ライブラリのパス。 これは、\f(CW\*(C`LD_PRELOAD\*(C'\fR やそれに相当するものを サポートしているシステムで \fInoexec\fR 機能を実現するために使用される。 デフォルトでは \fI/usr/local/libexec/sudo_noexec.so\fR になっている。 .IP "passprompt" 16 .IX Item "passprompt" .\"O The default prompt to use when asking for a password; can be overridden .\"O via the \fB\-p\fR option or the \f(CW\*(C`SUDO_PROMPT\*(C'\fR environment variable. .\"O The following percent (`\f(CW\*(C`%\*(C'\fR') escapes are supported: パスワードを要求するときに使用するデフォルトのプロンプト。\fB-p\fR オ プションや環境変数 \f(CW\*(C`SUDO_PROMPT\*(C'\fR によって変更すること ができる。以下のパーセント (`\f(CW\*(C`%\*(C'\fR') エスケープが使用で きる。 .RS 16 .ie n .IP "%H" 4 .el .IP "\f(CW%H\fR" 4 .IX Item "%H" .\"O expanded to the local hostname including the domain name .\"O (on if the machine's hostname is fully qualified or the \fIfqdn\fR .\"O option is set) ドメイン名付きのローカルホスト名に展開 (マシンのホスト名が完全修飾名か、 \&\fIfqdn\fR オプションがセットされている場合に有効) .ie n .IP "%h" 4 .el .IP "\f(CW%h\fR" 4 .IX Item "%h" .\"O expanded to the local hostname without the domain name ドメイン名なしのローカルホスト名に展開 .ie n .IP "%p" 4 .el .IP "\f(CW%p\fR" 4 .IX Item "%p" .\"O expanded to the user whose password is being asked for (respects the .\"O \&\fIrootpw\fR, \fItargetpw\fR and \fIrunaspw\fR flags in \fIsudoers\fR) パスワードを要求されているユーザ名に展開 (\fIsudoers\fR ファイルの \&\fIrootpw\fR, \fItargetpw\fR, \fIrunaspw\fR フラグを尊重する) .ie n .IP "%U" 4 .el .IP "\f(CW%U\fR" 4 .IX Item "%U" .\"O expanded to the login name of the user the command will .\"O be run as (defaults to root) 変身対象ユーザの (デフォルトでは root) ログイン名に展開 .ie n .IP "%u" 4 .el .IP "\f(CW%u\fR" 4 .IX Item "%u" .\"O expanded to the invoking user's login name \&\fBsudo\fR を起動するユーザのログイン名に展開 .ie n .IP "\*(C`%%\*(C'" 4 .el .IP "\f(CW\*(C`%%\*(C'\fR" 4 .IX Item "%%" .\"O two consecutive \f(CW\*(C`%\*(C'\fR characters are collapsed into a single \f(CW\*(C`%\*(C'\fR character 連続した二個の \f(CW\*(C`%\*(C'\fR は、一個の \f(CW\*(C`%\*(C'\fR 文字 そのものを意味する .RE .RS 16 .Sp .\"O The default value is \f(CW\*(C`Password:\*(C'\fR. デフォルトの値は「\f(CW\*(C`Password:\*(C'\fR」である。 .RE .\" .IP "role" 16 .\" .IX Item "role" .\" The default SELinux role to use when constructing a new security .\" context to run the command. The default role may be overridden on .\" a per-command basis in \fIsudoers\fR or via command line options. .\" This option is only available whe \fBsudo\fR is built with SELinux support. .\" コマンドを実行するために SELinux の新しいセキュリティ・コンテキストを .\" 構成するとき、使用するデフォルトのロール。デフォルトのロールは、 .\" \&\fIsudoers\fR ファイルや、コマンドラインオプションを使って、コマンド .\" ごとに変更することができる。このオプションが利用できるのは、\fBsudo\fR .\" が SELinux サポートつきで作成されたときだけである。 .IP "runas_default" 16 .IX Item "runas_default" .\"O The default user to run commands as if the \fB\-u\fR option is not specified .\"O on the command line. This defaults to \f(CW\*(C`root\*(C'\fR. .\"O Note that if \fIrunas_default\fR is set it \fBmust\fR occur before .\"O any \f(CW\*(C`Runas_Alias\*(C'\fR specifications. コマンドラインで \fB-u\fR オプションが指定されていないときの、デフォルトの 変身対象ユーザ。デフォルトでは \f(CW\*(C`root\*(C'\fR になっている。 \fIrunas_default\fR をセットするなら、\f(CW\*(C`Runas_Alias\*(C'\fR を 指定するよりも前にやらなければならないことに注意すること。 .IP "syslog_badpri" 16 .IX Item "syslog_badpri" .\"O Syslog priority to use when user authenticates unsuccessfully. .\"O Defaults to \f(CW\*(C`alert\*(C'\fR. ユーザが認証に失敗したときに使用する syslog の優先順位 (priority)。デ フォルトでは \f(CW\*(C`alert\*(C'\fR になっている。 .IP "syslog_goodpri" 16 .IX Item "syslog_goodpri" .\"O Syslog priority to use when user authenticates successfully. .\"O Defaults to \f(CW\*(C`notice\*(C'\fR. ユーザが認証に成功したときに使用する syslog の優先順位 (priority)。デ フォルトでは \f(CW\*(C`notice\*(C'\fR になっている。 .IP "sudoers_locale" 16 .IX Item "sudoers_locale" .\"O Locale to use when parsing the sudoers file. Note that changing .\"O the locale may affect how sudoers is interpreted. .\"O Defaults to \f(CW"C"\fR. sudoers ファイルを解析するときに使用するロケール。ロケールの変更は、 sudoers の解釈に影響があるかもしれないので、注意してほしい。 デフォルトでは \f(CW"C"\fR になっている。 .IP "timestampdir" 16 .IX Item "timestampdir" .\"O The directory in which \fBsudo\fR stores its timestamp files. .\"O The default is \fI/var/run/sudo\fR. \&\fBsudo\fR がタイムスタンプ・ファイルを置くディレクトリ。デフォルト は \fI/var/run/sudo\fR である。 .IP "timestampowner" 16 .IX Item "timestampowner" .\"O The owner of the timestamp directory and the timestamps stored therein. .\"O The default is \f(CW\*(C`root\*(C'\fR. タイムスタンプ・ディレクトリとそこに置かれるタイムスタンプの所有者。デ フォルトは \f(CW\*(C`root\*(C'\fR である。 .\" .IP "type" 16 .\" .IX Item "type" .\" The default SELinux type to use when constructing a new security .\" context to run the command. The default type may be overridden on .\" a per-command basis in \fIsudoers\fR or via command line options. .\" This option is only available whe \fBsudo\fR is built with SELinux support. .\" コマンドを実行するために SELinux の新しいセキュリティ・コンテキストを .\" 構成するとき、使用するデフォルトのタイプ。デフォルトのタイプは、 .\" \&\fIsudoers\fR ファイルや、コマンドラインオプションを使って、コマンド .\" ごとに変更することができる。このオプションが利用できるのは、\fBsudo\fR .\" が SELinux サポートつきで作成されたときだけである。 .PP .\"O \&\fBStrings that can be used in a boolean context\fR: \&\fB真偽値としても使用できる文字列\fR: .IP "askpass" 12 .IX Item "askpass" .\"O The \fIaskpass\fR option specifies the fully qualified path to a helper .\"O program used to read the user's password when no terminal is .\"O available. This may be the case when \fBsudo\fR is executed from a .\"O graphical (as opposed to text-based) application. The program .\"O specified by \fIaskpass\fR should display the argument passed to it .\"O as the prompt and write the user's password to the standard output. .\"O The value of \fIaskpass\fR may be overridden by the \f(CW\*(C`SUDO_ASKPASS\*(C'\fR .\"O environment variable. \&\fIaskpass\fR で指定するのは、ヘルパー・プログラムの絶対パスである。 このヘルパー・プログラムは、ターミナルを利用できないときに、 ユーザのパスワードを読み込むために使用する。たとえば、\fBsudo\fR が (テキストベースではなく) グラフィカルなアプリケーションから実行される といった場合だ。\fIaskpass\fR で指定されたヘルパー・プログラムは、 渡された引き数をプロンプトとして表示し、ユーザのパスワードを標準出力に 書き出すべきである。 \&\fIaskpass\fR の値は、環境変数 \f(CW\*(C`SUDO_ASKPASS\*(C'\fR で 上書きすることができる。 .IP "env_file" 12 .IX Item "env_file" .\"O The \fIenv_file\fR options specifies the fully qualified path to a .\"O file containing variables to be set in the environment of the program .\"O being run. Entries in this file should either be of the form .\"O \&\f(CW\*(C`VARIABLE=value\*(C'\fR or \f(CW\*(C`export VARIABLE=value\*(C'\fR. The value may .\"O optionally be surrounded by single or double quotes. Variables in .\"O this file are subject to other \fBsudo\fR environment settings such .\"O as \fIenv_keep\fR and \fIenv_check\fR. \&\fIenv_file\fR オプションでファイルの絶対パスを指定すると、 実行するプログラムの環境として設定する変数をそのファイルに格納して おくことができる。このファイルのエントリは \f(CW\*(C`VARIABLE=value\*(C'\fR か \f(CW\*(C`export VARIABLE=value\*(C'\fR の形でなければならない。 変数の値をシングルクォートやダブルクォートで囲んでもよい。 このファイルに含まれる変数は、\fIenv_keep\fR や \fIenv_check\fR のような \&\fBsudo\fR のほかの環境設定の影響を受ける。 .IP "exempt_group" 12 .IX Item "exempt_group" .\"O Users in this group are exempt from password and \s-1PATH\s0 requirements. .\"O This is not set by default. このグループのユーザはパスワードの入力や \fIsecure_path\fR による \&\s-1PATH\s0 の限定を免除されている。このオプションはデフォルトでは セットされていない。 .IP "lecture" 12 .IX Item "lecture" .\"O This option controls when a short lecture will be printed along with .\"O the password prompt. It has the following possible values: \&\fBsudo\fR はパスワードプロンプトに添えて簡単な訓戒を表示することが できる。このオプションはその訓戒をいつ表示するかを決定する。以下の値が 可能である。 .RS 12 .IP "always" 8 .IX Item "always" .\"O Always lecture the user. いつでも必ず訓戒を表示する .IP "never" 8 .IX Item "never" .\"O Never lecture the user. 訓戒を一切表示しない。 .IP "once" 8 .IX Item "once" .\"O Only lecture the user the first time they run \fBsudo\fR. ユーザがはじめて \fBsudo\fR を実行したときだけ表示する。 .RE .RS 12 .Sp .\"O If no value is specified, a value of \fIonce\fR is implied. .\"O Negating the option results in a value of \fInever\fR being used. .\"O The default value is \fIonce\fR. 値を指定しないと、\fIonce\fR を指定したことになる。頭に '!' を付けて、 このオプションを否定すると、値に \fInever\fR が使用される。 デフォルトの値は \fIonce\fR である。 .RE .IP "lecture_file" 12 .IX Item "lecture_file" .\"O Path to a file containing an alternate \fBsudo\fR lecture that will .\"O be used in place of the standard lecture if the named file exists. .\"O By default, \fBsudo\fR uses a built-in lecture. 標準の訓戒の代わりに使用する \fBsudo\fR の訓戒を書き込んだファイルがあるなら、 \&\fIlecture_file\fR でそのパスを指定する。\fBsudo\fR はデフォルトでは、 プログラムに埋め込まれた訓戒を使用する。 .IP "listpw" 12 .IX Item "listpw" .\"O This option controls when a password will be required when a .\"O user runs \fBsudo\fR with the \fB\-l\fR option. It has the following possible values: このオプションは、\fBsudo\fB を\fB\ -l\fR オプション付きで実行したとき、 ユーザがパスワードを要求されるのは、どんな場合かを決定する。 以下のような値が可能である。 .RS 12 .IP "all" 8 .IX Item "all" .\"O All the user's \fIsudoers\fR entries for the current host must have .\"O the \f(CW\*(C`NOPASSWD\*(C'\fR flag set to avoid entering a password. パスワードを入力しないですむためには、\fIsudoers\fR ファイルの使用中の ホストに対する当該ユーザのエントリのすべてに \&\f(CW\*(C`NOPASSWD\*(C'\fR タグが設定されていなければならない。 .IP "always" 8 .IX Item "always" .\"O The user must always enter a password to use the \fB\-l\fR option. ユーザは \fB\-l\fR オプションを使用する際に必ずパスワードを入力しなければ ならない。 .IP "any" 8 .IX Item "any" .\"O At least one of the user's \fIsudoers\fR entries for the current host .\"O must have the \f(CW\*(C`NOPASSWD\*(C'\fR flag set to avoid entering a password. パスワードを入力しないですむためには、\fIsudoers\fR ファイルの使用中の ホストに対する当該ユーザのエントリの少なくとも一つに \&\f(CW\*(C`NOPASSWD\*(C'\fR タグが設定されていなければならない。 .IP "never" 8 .IX Item "never" .\"O The user need never enter a password to use the \fB\-l\fR option. ユーザは \fB\-l\fR オプションを使用する際にパスワードを入力する必要が まったくない。 .RE .RS 12 .Sp .\"O If no value is specified, a value of \fIany\fR is implied. .\"O Negating the option results in a value of \fInever\fR being used. .\"O The default value is \fIany\fR. 値を指定しないと、値は \fIany\fR だと見なされる。'!' を頭に付けて、 このオプションを否定すると、値に \fInever\fR が使われることになる。 デフォルトは \fIany\fR である。 .RE .IP "logfile" 12 .IX Item "logfile" .\"O Path to the \fBsudo\fR log file (not the syslog log file). Setting a path .\"O turns on logging to a file; negating this option turns it off. .\"O By default, \fBsudo\fR logs via syslog. \&\fBsudo\fR のログファイルのパス (syslog 経由のログファイルではない)。 パスを指定すると、ファイルへのロギングが on になり、 '!' を頭に付けて、 このオプションを否定すると、off になる。デフォルトでは、\fBsudo\fR は syslog 経由でログを取る。 .IP "mailerflags" 12 .IX Item "mailerflags" .\"O Flags to use when invoking mailer. Defaults to \fB\-t\fR. メーラを起動するときに使用するフラグ。デフォルトは \fB\-t\fR に なっている。 .IP "mailerpath" 12 .IX Item "mailerpath" .\"O Path to mail program used to send warning mail. .\"O Defaults to the path to sendmail found at configure time. 警告メールの送信に使うメール・プログラムのパス。デフォルトは configure したときに見つかった sendmail のパス。 .IP "mailfrom" 12 .IX Item "mailfrom" .\"O Address to use for the \*(L"from\*(R" address when sending warning and error .\"O mail. The address should be enclosed in double quotes (\f(CW\*(C`"\*(C'\fR) to .\"O protect against \fBsudo\fR interpreting the \f(CW\*(C`@\*(C'\fR sign. Defaults to .\"O the name of the user running \fBsudo\fR. 警告メールやエラー・メールを送るとき、差出人として使用するアドレス。 \&\fBsudo\fR が \f(CW\*(C`@\*(C'\fR 記号を解釈しないようにするため、 アドレスはダブルクォート (\f(CW\*(C`"\*(C'\fR) で囲むべきである。 デフォルトは、\fBsudo\fR を実行するユーザの名前。 .IP "mailto" 12 .IX Item "mailto" .\"O Address to send warning and error mail to. The address should .\"O be enclosed in double quotes (\f(CW\*(C`"\*(C'\fR) to protect against \fBsudo\fR .\"O interpreting the \f(CW\*(C`@\*(C'\fR sign. Defaults to \f(CW\*(C`root\*(C'\fR. 警告メールやエラー・メールを送付する宛先のアドレス。\fBsudo\fR が \&\f(CW\*(C`@\*(C'\fR 記号を解釈しないようにするため、アドレスは ダブルクォート (\f(CW\*(C`"\*(C'\fR) で囲むべきである。デフォルトは root に なっている。 .IP "secure_path" 12 .IX Item "secure_path" .\"O Path used for every command run from \fBsudo\fR. If you don't trust the .\"O people running \fBsudo\fR to have a sane \f(CW\*(C`PATH\*(C'\fR environment variable you may .\"O want to use this. Another use is if you want to have the \*(L"root path\*(R" .\"O be separate from the \*(L"user path.\*(R" Users in the group specified by the .\"O \&\fIexempt_group\fR option are not affected by \fIsecure_path\fR. .\"O This is not set by default. \&\fBsudo\fR から実行されるあらゆるコマンドが使用するパス。 \&\fBsudo\fR を実行するユーザが、無難な環境変数 \f(CW\*(C`PATH\*(C'\fR を 使っているかどうか確信が持てないなら、このオプションを使用するとよいだろう。 もう一つの使用法は、「root のパス」と「一般ユーザのパス」を別のものに しておきたい場合だ。ユーザが \fIexempt_group\fR オプションで指定した グループに属していると、そのユーザは \fIsecure_path\fR の影響を受けない。 このオプションは、デフォルトではセットされていない。 .IP "syslog" 12 .IX Item "syslog" .\"O Syslog facility if syslog is being used for logging (negate to .\"O disable syslog logging). Defaults to \f(CW\*(C`local2\*(C'\fR. syslog を使ってログを取っている場合の syslog のファシリティ (syslog 経由で ログを取らない場合は、'!' を頭に付けて、このオプションを否定する)。 デフォルトは \f(CW\*(C`local2\*(C'\fR になっている。 .IP "verifypw" 12 .IX Item "verifypw" .\"O This option controls when a password will be required when a user runs .\"O \&\fBsudo\fR with the \fB\-v\fR option. It has the following possible values: このオプションは、\fBsudo\fR を \fB\-v\fR オプション付きで実行したとき、 ユーザがパスワードを要求されるのは、どんな場合かを決定する。次のような 値が可能である。 .RS 12 .IP "all" 8 .IX Item "all" .\"O All the user's \fIsudoers\fR entries for the current host must have .\"O the \f(CW\*(C`NOPASSWD\*(C'\fR flag set to avoid entering a password. パスワードを入力しないですむためには、\fIsudoers\fR ファイルの使用中の ホストに対する当該ユーザのエントリのすべてに \&\f(CW\*(C`NOPASSWD\*(C'\fR タグが設定されていなければならない。 .IP "always" 8 .IX Item "always" .\"O The user must always enter a password to use the \fB\-v\fR option. ユーザは \fB\-v\fR オプションを使用する際に必ずパスワードを入力しなければ ならない。 .IP "any" 8 .IX Item "any" .\"O At least one of the user's \fIsudoers\fR entries for the current host .\"O must have the \f(CW\*(C`NOPASSWD\*(C'\fR flag set to avoid entering a password. パスワードを入力しないですむためには、\fIsudoers\fR ファイルの使用中の ホストに対する当該ユーザのエントリの少なくとも一つに \f(CW\*(C`NOPASSWD\*(C'\fR タグが設定されていなければならない。 .IP "never" 8 .IX Item "never" .\"O The user need never enter a password to use the \fB\-v\fR option. ユーザは \fB\-v\fR オプションを使用する際にパスワードを入力する必要が まったくない。 .RE .RS 12 .Sp .\"O If no value is specified, a value of \fIall\fR is implied. .\"O Negating the option results in a value of \fInever\fR being used. .\"O The default value is \fIall\fR. 値を指定しないと、値は \fIall\fR だと見なされる。'!' を頭に付けて、 このオプションを否定すると、値に \fInever\fR が使われることになる。 デフォルトは \fIall\fR である。 .RE .PP .\"O \&\fBLists that can be used in a boolean context\fR: \&\fB真偽値としても使用できるリスト\fR: .IP "env_check" 16 .IX Item "env_check" .\"O Environment variables to be removed from the user's environment if .\"O the variable's value contains \f(CW\*(C`%\*(C'\fR or \f(CW\*(C`/\*(C'\fR characters. This can .\"O be used to guard against printf-style format vulnerabilities in .\"O poorly-written programs. The argument may be a double-quoted, .\"O space-separated list or a single value without double-quotes. The .\"O list can be replaced, added to, deleted from, or disabled by using .\"O the \f(CW\*(C`=\*(C'\fR, \f(CW\*(C`+=\*(C'\fR, \f(CW\*(C`\-=\*(C'\fR, and \f(CW\*(C`!\*(C'\fR operators respectively. Regardless .\"O of whether the \f(CW\*(C`env_reset\*(C'\fR option is enabled or disabled, variables .\"O specified by \f(CW\*(C`env_check\*(C'\fR will be preserved in the environment if .\"O they pass the aforementioned check. The default list of environment .\"O variables to check is displayed when \fBsudo\fR is run by root with .\"O the \fI\-V\fR option. 変数の値に \f(CW\*(C`%\*(C'\fR や \f(CW\*(C`/\*(C'\fR が含まれる場合に、 ユーザの環境から取り除かれる環境変数。 この機能は、出来のよくないプログラムに見られる printf 形式のフォーマットの 脆弱性に対処するために利用できる。このオプションの引き数は、 ダブルクォートで囲まれ、スペースで区切られたリストでもよく、 ダブルクォートなしの単一の値でもよい。リストは、\f(CW\*(C`=\*(C'\fR, \&\f(CW\*(C`+=\*(C'\fR, \f(CW\*(C`\-=\*(C'\fR, \f(CW\*(C`!\*(C'\fR 演算子を 使って、それぞれ置き換えたり、追加したり、削除したり、無効にしたり することができる。\fIenv_check\fR で指定された変数は、 \&\fIenv_reset\fR オプショの有効・無効にかかわらず、上記のチェックに パスすれば、環境に保存されることになる。チェックされる環境変数の デフォルトのリストは、root ユーザが \fBsudo\fR に \&\fI\-V\fR オプションを 付けて実行したときに表示される。 .IP "env_delete" 16 .IX Item "env_delete" .\"O Environment variables to be removed from the user's environment .\"O when the \fIenv_reset\fR option is not in effect. The argument may .\"O be a double-quoted, space-separated list or a single value without .\"O double-quotes. The list can be replaced, added to, deleted from, .\"O or disabled by using the \f(CW\*(C`=\*(C'\fR, \f(CW\*(C`+=\*(C'\fR, \f(CW\*(C`\-=\*(C'\fR, and \f(CW\*(C`!\*(C'\fR operators .\"O respectively. The default list of environment variables to remove .\"O is displayed when \fBsudo\fR is run by root with the \fI\-V\fR option. .\"O Note that many operating systems will remove potentially dangerous .\"O variables from the environment of any setuid process (such as .\"O \&\fBsudo\fR). \&\fIenv_reset\fR オプションが無効になっているときに、ユーザの環境から 取り除かれる環境変数。このオプションの引き数は、ダブルクォートで囲まれ、 スペースで区切られたリストでもよく、ダブルクォートなしの単一の値でもよい。 リストは、\f(CW\*(C`=\*(C'\fR, \f(CW\*(C`+=\*(C'\fR, \f(CW\*(C`\-=\*(C'\fR, \&\f(CW\*(C`!\*(C'\fR 演算子を使って、それぞれ置き換えたり、追加したり、 削除したり、無効にしたりすることができる。取り除かれる環境変数の デフォルトのリストは、root ユーザが \fBsudo\fR に \fI\-V\fR オプションを 付けて実行したときに表示される。留意すべきは、オペレーティングシステムには、 危険をもたらしかねない変数をいかなる setuid プロセス (\fBsudo\fR も その一つ) の環境からも取り除くことにしているものが多いということである。 .IP "env_keep" 16 .IX Item "env_keep" .\"O Environment variables to be preserved in the user's environment .\"O when the \fIenv_reset\fR option is in effect. This allows fine-grained .\"O control over the environment \fBsudo\fR\-spawned processes will receive. .\"O The argument may be a double-quoted, space-separated list or a .\"O single value without double-quotes. The list can be replaced, added .\"O to, deleted from, or disabled by using the \f(CW\*(C`=\*(C'\fR, \f(CW\*(C`+=\*(C'\fR, \f(CW\*(C`\-=\*(C'\fR, and .\"O \&\f(CW\*(C`!\*(C'\fR operators respectively. The default list of variables to keep .\"O is displayed when \fBsudo\fR is run by root with the \fI\-V\fR option. \&\fIenv_reset\fR オプションが有効になっているときでも、ユーザの環境に そのまま保存される環境変数。このオプションによって、\fBsudo\fR から 生み出されるプロセスが受け取る環境を、きめ細かく制御することが可能になる。 このオプションの引き数は、ダブルクォートで囲まれ、スペースで区切られたリ ストでもよく、ダブルクォートなしの単一の値でもよい。リストは、 \&\f(CW\*(C`=\*(C'\fR, \f(CW\*(C`+=\*(C'\fR, \f(CW\*(C`\-=\*(C'\fR, \&\f(CW\*(C`!\*(C'\fR 演算子を使って、それぞれ置き換えたり、 追加したり、削除したり、無効にしたりすることができる。保存される変数の デフォルトのリストは、root ユーザが \fBsudo\fR に \fI\-V\fR オプションを 付けて実行したときに表示される。 .PP .\"O When logging via \fIsyslog\fR\|(3), \fBsudo\fR accepts the following values .\"O for the syslog facility (the value of the \fBsyslog\fR Parameter): .\"O \&\fBauthpriv\fR (if your \s-1OS\s0 supports it), \fBauth\fR, \fBdaemon\fR, \fBuser\fR, .\"O \&\fBlocal0\fR, \fBlocal1\fR, \fBlocal2\fR, \fBlocal3\fR, \fBlocal4\fR, \fBlocal5\fR, .\"O \&\fBlocal6\fR, and \fBlocal7\fR. The following syslog priorities are .\"O supported: \fBalert\fR, \fBcrit\fR, \fBdebug\fR, \fBemerg\fR, \fBerr\fR, \fBinfo\fR, .\"O \&\fBnotice\fR, and \fBwarning\fR. \fIsyslog\fR\|(3) 経由でログを記録する場合、\fBsudo\fR は syslog のファ シリティ (facility: \fBsyslog\fR パラメータの値) として次の値を受け付 ける。\fBauthpriv\fR (ただし、\s-1OS\s0 がサポートしているならばだが)、 \&\fBauth\fR, \fBdaemon\fR, \fBuser\fR, \fBlocal0\fR, \fBlocal1\fR, \&\fBlocal2\fR, \fBlocal3\fR, \fBlocal4\fR, \fBlocal5\fR, \&\fBlocal6\fR, \fBlocal7\fR。syslog の優先順位 (priority) については、 次のものに対応している。\fBalert\fR, \fBcrit\fR, \fBdebug\fR, \&\fBemerg\fR, \fBerr\fR, \fBinfo\fR, \fBnotice\fR, \fBwarning\fR。 .\"O .SH "FILES" .SH "ファイル" .IX Header "FILES" .ie n .IP "\fI/etc/sudoers\fR" 24 .el .IP "\fI/etc/sudoers\fR" 24 .IX Item "/etc/sudoers" .\"O List of who can run what 誰が何を実行できるかのリスト .IP "\fI/etc/group\fR" 24 .IX Item "/etc/group" .\"O Local groups file ローカルのグループファイル .IP "\fI/etc/netgroup\fR" 24 .IX Item "/etc/netgroup" .\"O List of network groups ネットワークグループのリスト .\"O .SH "EXAMPLES" .SH "用例" .IX Header "EXAMPLES" .\"O Below are example \fIsudoers\fR entries. Admittedly, some of .\"O these are a bit contrived. First, we define our \fIaliases\fR: .\"O .PP 以下は sudoers エントリの見本である。正直なところ、いささか 凝りすぎの部分もある。まず最初にエイリアスを定義する。 .PP .Vb 4 .\"O \& # User alias specification \& # User alias の指定 \& User_Alias FULLTIMERS = millert, mikef, dowdy \& User_Alias PARTTIMERS = bostley, jwfox, crawl \& User_Alias WEBMASTERS = will, wendy, wim \& .\"O \& # Runas alias specification \& # Runas alias の指定 \& Runas_Alias OP = root, operator \& Runas_Alias DB = oracle, sybase \& Runas_Alias ADMINGRP = adm, oper \& .\"O \& # Host alias specification \& # Host alias の指定 \& Host_Alias SPARC = bigtime, eclipse, moet, anchor :\e \& SGI = grolsch, dandelion, black :\e \& ALPHA = widget, thalamus, foobar :\e \& HPPA = boa, nag, python \& Host_Alias CUNETS = 128.138.0.0/255.255.0.0 \& Host_Alias CSNETS = 128.138.243.0, 128.138.204.0/24, 128.138.242.0 \& Host_Alias SERVERS = master, mail, www, ns \& Host_Alias CDROM = orion, perseus, hercules \& .\"O \& # Cmnd alias specification \& # Cmnd alias の指定 \& Cmnd_Alias DUMPS = /usr/bin/mt, /usr/sbin/dump, /usr/sbin/rdump,\e \& /usr/sbin/restore, /usr/sbin/rrestore \& Cmnd_Alias KILL = /usr/bin/kill \& Cmnd_Alias PRINTING = /usr/sbin/lpc, /usr/bin/lprm \& Cmnd_Alias SHUTDOWN = /usr/sbin/shutdown \& Cmnd_Alias HALT = /usr/sbin/halt \& Cmnd_Alias REBOOT = /usr/sbin/reboot \& Cmnd_Alias SHELLS = /usr/bin/sh, /usr/bin/csh, /usr/bin/ksh, \e \& /usr/local/bin/tcsh, /usr/bin/rsh, \e \& /usr/local/bin/zsh \& Cmnd_Alias SU = /usr/bin/su \& Cmnd_Alias PAGERS = /usr/bin/more, /usr/bin/pg, /usr/bin/less .Ve .PP .\"O Here we override some of the compiled in default values. We want .\"O \&\fBsudo\fR to log via \fIsyslog\fR\|(3) using the \fIauth\fR facility in all .\"O cases. We don't want to subject the full time staff to the \fBsudo\fR .\"O lecture, user \fBmillert\fR need not give a password, and we don't .\"O want to reset the \f(CW\*(C`LOGNAME\*(C'\fR, \f(CW\*(C`USER\*(C'\fR or \f(CW\*(C`USERNAME\*(C'\fR environment .\"O variables when running commands as root. Additionally, on the .\"O machines in the \fI\s-1SERVERS\s0\fR \f(CW\*(C`Host_Alias\*(C'\fR, we keep an additional .\"O local log file and make sure we log the year in each log line since .\"O the log entries will be kept around for several years. Lastly, we .\"O disable shell escapes for the commands in the \s-1PAGERS\s0 \f(CW\*(C`Cmnd_Alias\*(C'\fR .\"O (\fI/usr/bin/more\fR, \fI/usr/bin/pg\fR and \fI/usr/bin/less\fR). .\"O .PP 以下では、コンパイル時に埋め込まれたデフォルト値のいくつかを変更している。 \&\fBsudo\fR には \fIsyslog\fR\|(3) 経由でログを記録し、ファシリティには すべての場合に \fIauth\fR を使用させたい。フルタイムのスタッフには \&\fBsudo\fR の訓戒を出さないようにしたい。ユーザ \fBmillert\fR は パスワードを入力しないでよい。コマンドを root として実行するときは、 環境変数 \f(CW\*(C`LOGNAME\*(C'\fR, \f(CW\*(C`USER\*(C'\fR, \&\f(CW\*(C`USERNAME\*(C'\fR を変更したくない。さらに、 \&\fI\s-1SERVERS\s0\fR という \f(CW\*(C`Host_Alias\*(C'\fR に属する マシンでは、ローカルなログファイルを副本として作り、ログの記入事項は 数年に渡って保存されるので、ログの各行に間違いなく年度が入るようにする。 最後に \s-1PAGERS\s0 という \f(CW\*(C`Cmnd_Alias\*(C'\fR に属する コマンド (\fI/usr/bin/more\fR, \fI/usr/bin/pg\fR, \fI/usr/bin/less\fR) については、シェル・エスケープを無効にする。 .PP .Vb 7 .\"O \& # Override built\-in defaults \& # built-in defaults の変更 \& Defaults syslog=auth \& Defaults>root !set_logname \& Defaults:FULLTIMERS !lecture \& Defaults:millert !authenticate \& Defaults@SERVERS log_year, logfile=/var/log/sudo.log \& Defaults!PAGERS noexec .Ve .PP .\"O The \fIUser specification\fR is the part that actually determines who may .\"O run what. .\"O .PP ユーザ設定が、誰が何を実行できるかを実際に決めている部分だ。 .PP .Vb 2 \& root ALL = (ALL) ALL \& %wheel ALL = (ALL) ALL .Ve .PP .\"O We let \fBroot\fR and any user in group \fBwheel\fR run any command on any .\"O host as any user. .\"O .PP \&\fBroot\fR と \fBwheel\fR グループのすべてのユーザには、どのホストでも 任意のユーザとしていかなるコマンドでも実行することを認める。 .PP .Vb 1 \& FULLTIMERS ALL = NOPASSWD: ALL .Ve .PP .\"O Full time sysadmins (\fBmillert\fR, \fBmikef\fR, and \fBdowdy\fR) may run any .\"O command on any host without authenticating themselves. .\"O .PP フルタイムのシステム管理者 (\fBmillert\fR, \fBmikef\fR, \fBdowdy\fR) は、どのホストでも任意のコマンドを認証なしで実行できる。 .PP .Vb 1 \& PARTTIMERS ALL = ALL .Ve .PP .\"O Part time sysadmins (\fBbostley\fR, \fBjwfox\fR, and \fBcrawl\fR) may run any .\"O command on any host but they must authenticate themselves first .\"O (since the entry lacks the \f(CW\*(C`NOPASSWD\*(C'\fR tag). .\"O .PP パートタイムのシステム管理者 ((\fBbostley\fR, \fBjwfox\fR, \&\fBcrawl\fR) は、どのホストでも任意のコマンドを実行できるが、 その際に認証をしなければならない (このエントリには \&\f(CW\*(C`NOPASSWD\*(C'\fR タグが指定されていないので)。 .PP .Vb 1 \& jack CSNETS = ALL .Ve .PP .\"O The user \fBjack\fR may run any command on the machines in the \fI\s-1CSNETS\s0\fR alias .\"O (the networks \f(CW128.138.243.0\fR, \f(CW128.138.204.0\fR, and \f(CW128.138.242.0\fR). .\"O Of those networks, only \f(CW128.138.204.0\fR has an explicit netmask (in .\"O \&\s-1CIDR\s0 notation) indicating it is a class C network. For the other .\"O networks in \fI\s-1CSNETS\s0\fR, the local machine's netmask will be used .\"O during matching. .\"O .PP ユーザ \fBjack\fR は、\fI\s-1CSNETS\s0\fR というエイリアスに属するマシンで 任意のコマンドを実行できる (すなわち、ネットワークが \f(CW128.138.243.0\fR, \&\f(CW128.138.204.0\fR, \f(CW128.138.242.0\fR のマシンだ)。この内、 \&\f(CW128.138.204.0\fR にのみ class C のネットワークであることを示す 明示的な (\s-1CIDR\s0 表記の) netmask がある。\fI\s-1CSNETS\s0\fR の ほかのネットワークについては、ローカルマシンの netmask がマッチングの際に 使われることになる。 .PP .Vb 1 \& lisa CUNETS = ALL .Ve .PP .\"O The user \fBlisa\fR may run any command on any host in the \fI\s-1CUNETS\s0\fR alias .\"O (the class B network \f(CW128.138.0.0\fR). .\"O .PP ユーザ \fBlisa\fR はエイリアスが \fI\s-1CUNETS\s0\fR のいかなるホストでも 任意のコマンドを実行することができる (すなわち、 \f(CW128.138.0.0\fR という class B ネットワークのマシンだ)。 .PP .Vb 2 \& operator ALL = DUMPS, KILL, SHUTDOWN, HALT, REBOOT, PRINTING,\e \& sudoedit /etc/printcap, /usr/oper/bin/ .Ve .PP .\"O The \fBoperator\fR user may run commands limited to simple maintenance. .\"O Here, those are commands related to backups, killing processes, the .\"O printing system, shutting down the system, and any commands in the .\"O directory \fI/usr/oper/bin/\fR. .\"O .PP ユーザ \fBoperator\fR は、用途が簡単な保守管理に限定されたコマンドを 実行できる。この場合それは、バックアップしたり、プロセスを kill したり、 印刷システムを操作したり、システムをシャットダウンしたりするのに 関係するコマンドと、\fI/usr/oper/bin/\fR ディレクトリにある任意のコマンド である。 .PP .Vb 1 \& joe ALL = /usr/bin/su operator .Ve .PP .\"O The user \fBjoe\fR may only \fIsu\fR\|(1) to operator. .\"O .PP ユーザ \fBjoe\fR は \fIsu\fR\|(1) を使って operator になることしか できない。 .PP .Vb 1 .\"O \& pete HPPA = /usr/bin/passwd [A\-Za\-z]*, !/usr/bin/passwd root .\"O \& \& %opers ALL = (: ADMINGRP) /usr/sbin/ .Ve .PP .\"O Users in the \fBopers\fR group may run commands in \fI/usr/sbin/\fR as themselves .\"O with any group in the \fI\s-1ADMINGRP\s0\fR \f(CW\*(C`Runas_Alias\*(C'\fR (the \fBadm\fR and \fBoper\fR .\"O groups). .\"O .PP \&\fBopers\fR グループのユーザは、\fI/usr/sbin/\fR にあるコマンドを 自分自身の資格で、 \&\f(CW\*(C`Runas_Alias\*(C'\fR \fI\s-1ADMINGRP\s0\fR に属する 任意のグループ (すなわち、\fBadm\fR か \fBoper\fR グループ) として 実行できる。(訳注: 実のところ、sudo-1.7.2p1 では、 \&\fI/etc/sudoers\fR で変身可能グループに \f(CW\*(C`Runas_Alias\*(C'\fR を まだ指定できないようだ。今のところ、この例で言うなら、\fI\s-1ADMINGRP\s0\fR ではなく、\fBadm\fR や \fBoper\fR を直接指定しなければならない。) .PP .Vb 1 \& pete HPPA = /usr/bin/passwd [A\-Za\-z]*, !/usr/bin/passwd root .Ve .PP .\"O The user \fBpete\fR is allowed to change anyone's password except for .\"O root on the \fI\s-1HPPA\s0\fR machines. Note that this assumes \fIpasswd\fR\|(1) .\"O does not take multiple usernames on the command line. .\"O .PP ユーザ \fBpete\fR は \fI\s-1HPPA\s0\fR に属するマシンで root 以外なら 誰のパスワードでも変更することを許されている。上記の指定は、 \&\fIpasswd\fR\|(1) がコマンドラインで複数のユーザ名を受け付けないことを 前提としている点に注意してほしい。 .PP .Vb 1 \& bob SPARC = (OP) ALL : SGI = (OP) ALL .Ve .PP .\"O The user \fBbob\fR may run anything on the \fI\s-1SPARC\s0\fR and \fI\s-1SGI\s0\fR machines .\"O as any user listed in the \fI\s-1OP\s0\fR \f(CW\*(C`Runas_Alias\*(C'\fR (\fBroot\fR and \fBoperator\fR). .\"O .PP ユーザ \fBbob\fR は \fI\s-1SPARC\s0\fR や \fI\s-1SGI\s0\fR に属する マシンで \f(CW\*(C`Runas_Alias\*(C'\fR \fI\s-1OP\s0\fR に登録されている 任意のユーザとして (\fBroot\fR と \fBoperator\fR である) どんなコマンドでも 実行できる。 .PP .Vb 1 \& jim +biglab = ALL .Ve .PP .\"O The user \fBjim\fR may run any command on machines in the \fIbiglab\fR netgroup. .\"O \&\fBsudo\fR knows that \*(L"biglab\*(R" is a netgroup due to the '+' prefix. .\"O .PP ユーザ \fBjim\fR は \fIbiglab\fR ネットグループに属するマシンで どんなコマンドでも実行できる。\fBsudo\fR は、\*(L"biglab\*(R" に '+' の 接頭辞が付いているので、それをネットグループだと認識する。 .PP .Vb 1 \& +secretaries ALL = PRINTING, /usr/bin/adduser, /usr/bin/rmuser .Ve .PP .\"O Users in the \fBsecretaries\fR netgroup need to help manage the printers .\"O as well as add and remove users, so they are allowed to run those .\"O commands on all machines. .\"O .PP \&\fBsecretaries\fR ネットグループのユーザは、ユーザの追加や削除は もちろん、プリンタの管理にも協力する必要がある。そこで、すべてのマシンで その種のコマンドの実行を認められている。 .PP .Vb 1 \& fred ALL = (DB) NOPASSWD: ALL .Ve .PP .\"O The user \fBfred\fR can run commands as any user in the \fI\s-1DB\s0\fR \f(CW\*(C`Runas_Alias\*(C'\fR .\"O (\fBoracle\fR or \fBsybase\fR) without giving a password. .\"O .PP ユーザ \fBfred\fR は \f(CW\*(C`Runas_Alias\*(C'\fR \fI\s-1DB\s0\fR の 任意のユーザとして (\fBoracle\fR か \fBsybase\fR だ) パスワードを 入力しないでもコマンドを実行することができる。 .PP .Vb 1 \& john ALPHA = /usr/bin/su [!\-]*, !/usr/bin/su *root* .Ve .PP .\"O On the \fI\s-1ALPHA\s0\fR machines, user \fBjohn\fR may su to anyone except root .\"O but he is not allowed to specify any options to the \fIsu\fR\|(1) command. .\"O .PP ユーザ \fBjohn\fR は \fI\s-1ALPHA\s0\fR に属するマシンで \fIsu\fR\|(1) を 使って root 以外の誰にでもなることができるが、su にオプションを 指定することは許されていない。 .PP .Vb 1 \& jen ALL, !SERVERS = ALL .Ve .PP .\"O The user \fBjen\fR may run any command on any machine except for those .\"O in the \fI\s-1SERVERS\s0\fR \f(CW\*(C`Host_Alias\*(C'\fR (master, mail, www and ns). .\"O .PP ユーザ \fBjen\fR は \f(CW\*(C`Host_Alias\*(C'\fR \fI\s-1SERVERS\s0\fR に 属するマシン (master, mail, www, ns) を除くいかなるマシンでも 任意のコマンドを実行できる。 .PP .Vb 1 \& jill SERVERS = /usr/bin/, !SU, !SHELLS .Ve .PP .\"O For any machine in the \fI\s-1SERVERS\s0\fR \f(CW\*(C`Host_Alias\*(C'\fR, \fBjill\fR may run .\"O any commands in the directory \fI/usr/bin/\fR except for those commands .\"O belonging to the \fI\s-1SU\s0\fR and \fI\s-1SHELLS\s0\fR \f(CW\*(C`Cmnd_Aliases\*(C'\fR. .\"O .PP \&\fBjill\fR は \f(CW\*(C`Host_Alias\*(C'\fR \fI\s-1SERVERS\s0\fR の いかなるマシンでも \fI/usr/bin/\fR ディレクトリにある任意のコマンドを 実行できるが、\fI\s-1SU\s0\fR や \fI\s-1SHELLS\s0\fR という \&\f(CW\*(C`Cmnd_Aliases\*(C'\fR に属するコマンドは実行できない。 .PP .Vb 1 \& steve CSNETS = (operator) /usr/local/op_commands/ .Ve .PP .\"O The user \fBsteve\fR may run any command in the directory /usr/local/op_commands/ .\"O but only as user operator. .\"O .PP ユーザ \fBsteve\fR はディレクトリ \fI/usr/local/op_commands/\fR にある 任意のコマンドを実行できるが、operator というユーザとして実行できるだけだ。 .PP .Vb 1 \& matt valkyrie = KILL .Ve .PP .\"O On his personal workstation, valkyrie, \fBmatt\fR needs to be able to .\"O kill hung processes. .\"O .PP \&\fBmatt\fR も自分用のワークステーション valkyrie で ハングしたプロセスの kill ぐらいはできる必要がある。 .PP .Vb 1 \& WEBMASTERS www = (www) ALL, (root) /usr/bin/su www .Ve .PP .\"O On the host www, any user in the \fI\s-1WEBMASTERS\s0\fR \f(CW\*(C`User_Alias\*(C'\fR (will, .\"O wendy, and wim), may run any command as user www (which owns the .\"O web pages) or simply \fIsu\fR\|(1) to www. .\"O .PP ホスト www で \f(CW\*(C`User_Alias\*(C'\fR \fI\s-1WEBMASTERS\s0\fR に 属するいかなるユーザも (will, wendy, wim だ)、ユーザ www (web ページの 所有者) として任意のコマンドを実行することができる。 単に \fIsu\fR\|(1) で www になってもよい。 .PP .Vb 2 \& ALL CDROM = NOPASSWD: /sbin/umount /CDROM,\e \& /sbin/mount \-o nosuid\e,nodev /dev/cd0a /CDROM .Ve .PP .\"O Any user may mount or unmount a CD-ROM on the machines in the \s-1CDROM\s0 .\"O \&\f(CW\*(C`Host_Alias\*(C'\fR (orion, perseus, hercules) without entering a password. .\"O This is a bit tedious for users to type, so it is a prime candidate .\"O for encapsulating in a shell script. いかなるユーザも \f(CW\*(C`Host_Alias\*(C'\fR が \s-1CDROM\s0 の マシンで (orion, perseus, hercules)、パスワードを入力することなく CD-ROM をマウント、アンマウントできる。上記のコマンドを打ち込むのは ユーザにとっていささか面倒なので、シェルスクリプトとして カプセル化してしまうのがよいだろう。 .IP "[\fB訳注\fR]:" 8 .IX Item "footnote2" 当然と言えば当然だが、sudo は自ホストの /etc/sudoers しか読まない。 そこで、こういうことになる。AAA というホストに aaa というユーザが いるとしよう。ホスト AAA の /etc/sudoers に「ホスト BBB でユーザ aaa は sudo を介して /bin/ls を実行できる」という記述があったとしても、 ユーザ aaa がホスト AAA から telnet や ssh を使ったとき、ホスト BBB 上で sudo 経由で ls を実行できるわけではない。それができるためには、 ホスト BBB の /etc/sudoers に「BBB でユーザ aaa は sudo を介して /bin/ls を 実行できる」という記述がなければならないのだ。ホスト BBB で実行する sudo は BBB の sudo であり、BBB の sudo は BBB の /etc/sudoers しか 読まないのだから。 .Sp それでは、何故、上記の「用例」で自ホスト以外の設定が行われて いるのか? そもそも、sudoers の書式で自ホスト以外のホストを 指定できるのは、何故なのか? それは、管理しているサイトの すべてのホストの設定を記した sudoers ファイルを一つ作って、それを すべてのホストにコピーして使う、そういった使い方を想定しているからだ。 もし、サイト中のすべてのホストの設定を一ヶ所にまとめて置き、 それをすべてのホストに共有させたいのなら (すなわち、sudo の設定の 集中管理がしたいのなら)、LDAP の採用を考えるべきである。 .\"O .SH "SECURITY NOTES" .SH "セキュリティに関する注意点" .IX Header "SECURITY NOTES" .\"O It is generally not effective to \*(L"subtract\*(R" commands from \f(CW\*(C`ALL\*(C'\fR .\"O using the '!' operator. A user can trivially circumvent this .\"O by copying the desired command to a different name and then .\"O executing that. For example: .\"O .PP 一般的に言って、演算子 '!' を使用して \f(CW\*(C`ALL\*(C'\fR から コマンドの「引き算」をすることは、あまり効果がない。ユーザは実行したい コマンドを名前を変えてコピーし、それからそれを実行するするといった ちょっとした手段で、裏をかくことができるからだ。たとえば、 .PP .Vb 1 \& bill ALL = ALL, !SU, !SHELLS .Ve .PP .\"O Doesn't really prevent \fBbill\fR from running the commands listed in .\"O \&\fI\s-1SU\s0\fR or \fI\s-1SHELLS\s0\fR since he can simply copy those commands to a .\"O different name, or use a shell escape from an editor or other .\"O program. Therefore, these kind of restrictions should be considered .\"O advisory at best (and reinforced by policy). という行は、\fI\s-1SU\s0\fR や \fI\s-1SHELLS\s0\fR に列記されている コマンドの \fBbill\fR による実行を本当に阻止することにはならない。 なぜなら、\fBbill\fR としては、そうしたコマンドを単に名前を変えて コピーすればよいし、エディタやほかのプログラムからシェル・エスケープを 利用することもできるからだ。だから、この種の制限はやった方がまし程度に 考えておくべきだ (そして、しっかりした運用方針によって制限の実効力を 上げるべきである)。 .\"O .SH "PREVENTING SHELL ESCAPES" .SH "シェル・エスケープを防止する" .IX Header "PREVENTING SHELL ESCAPES" .\"O Once \fBsudo\fR executes a program, that program is free to do whatever .\"O it pleases, including run other programs. This can be a security .\"O issue since it is not uncommon for a program to allow shell escapes, .\"O which lets a user bypass \fBsudo\fR's access control and logging. .\"O Common programs that permit shell escapes include shells (obviously), .\"O editors, paginators, mail and terminal programs. .\"O .PP \&\fBsudo\fR があるプログラムを実行してしまうと、そのプログラムは、 ほかのプログラムの実行も含めて、何でも自由に好きなことができる。 このことがセキュリティ上の問題になりかねないのは、プログラムが シェル・エスケープを許しているのは珍しいことではなく、そのために ユーザが \fBsudo\fR のアクセス制御やロギングをすり抜けることが 可能になるからだ。よく使うプログラムでシェル・エスケープを 許しているものには、次のようなものがある。 (当然ながら) シェル、エディタ、ページャ、メーラ、ターミナル。 .PP .\"O There are two basic approaches to this problem: この問題に対処するには、基本的に二つの方法がある。 .\"O .IP "restrict" 10 .IP "制限" 10 .IX Item "restrict" .\"O Avoid giving users access to commands that allow the user to run .\"O arbitrary commands. Many editors have a restricted mode where shell .\"O escapes are disabled, though \fBsudoedit\fR is a better solution to .\"O running editors via \fBsudo\fR. Due to the large number of programs that .\"O offer shell escapes, restricting users to the set of programs that .\"O do not if often unworkable. ユーザに任意のコマンドの実行を許すようなコマンドに対して、ユーザが アクセスできないようにする。エディタの場合は、制限モードと称して、 シェル・エスケープが使えないモードを持っているものも多い。 もっとも、\fBsudo\fR 経由でエディタを使うのなら、 \&\fBsudoedit\fR を使用する方がよりすぐれた対策である。 シェル・エスケープを提供するプログラムはたくさんあるので、 それを提供しないプログラムのみを使用するようにユーザを制限するのは、 たいてい実現不可能である。 .IP "noexec" 10 .IX Item "noexec" .\"O Many systems that support shared libraries have the ability to .\"O override default library functions by pointing an environment .\"O variable (usually \f(CW\*(C`LD_PRELOAD\*(C'\fR) to an alternate shared library. .\"O On such systems, \fBsudo\fR's \fInoexec\fR functionality can be used to .\"O prevent a program run by \fBsudo\fR from executing any other programs. .\"O Note, however, that this applies only to native dynamically-linked .\"O executables. Statically-linked executables and foreign executables .\"O running under binary emulation are not affected. 共有ライブラリをサポートしている多くのシステムには、環境変数 (たいていは \&\f(CW\*(C`LD_PRELOAD\*(C'\fR) で別の共有ライブラリを指定することによって、 デフォルトのライブラリ関数を置き換える能力がある。 そういったシステムでは、\fBsudo\fR の \fInoexec\fR 機能を使えば、 \&\fBsudo\fR から実行されるプログラムが、何かほかのプログラムを実行するのを 防ぐことができる。とは言え、これが当てはまるのは、動的にリンクされた ネイティブなプログラムだけだということに気を付けてほしい。 静的にリンクされたプログラムや、バイナリ・エミュレーションのもとで 動くほかの OS のプログラムには効果がない。 .Sp .\"O To tell whether or not \fBsudo\fR supports \fInoexec\fR, you can run .\"O the following as root: \&\fBsudo\fR が \fInoexec\fR に対応しているかどうかを知りたかったら、 root ユーザになって次のように実行してみればよい。 .Sp .Vb 1 \& sudo \-V | grep "dummy exec" .Ve .Sp .\"O If the resulting output contains a line that begins with: その出力にこんなふうに始まる行があれば、 .Sp .Vb 1 \& File containing dummy exec functions: .Ve .Sp .\"O then \fBsudo\fR may be able to replace the exec family of functions .\"O in the standard library with its own that simply return an error. .\"O Unfortunately, there is no foolproof way to know whether or not .\"O \&\fInoexec\fR will work at compile-time. \fInoexec\fR should work on .\"O SunOS, Solaris, *BSD, Linux, \s-1IRIX\s0, Tru64 \s-1UNIX\s0, MacOS X, and HP-UX .\"O 11.x. It is known \fBnot\fR to work on \s-1AIX\s0 and UnixWare. \fInoexec\fR .\"O is expected to work on most operating systems that support the .\"O \&\f(CW\*(C`LD_PRELOAD\*(C'\fR environment variable. Check your operating system's .\"O manual pages for the dynamic linker (usually ld.so, ld.so.1, dyld, .\"O dld.sl, rld, or loader) to see if \f(CW\*(C`LD_PRELOAD\*(C'\fR is supported. そのときは、たぶん \fBsudo\fR が標準ライブラリにある exec ファミリーの関数を、 単にエラーを返すだけの自分自身の関数で置き換えられるということだ。 残念ながら、\fInoexec\fR が有効かどうか、コンパイル時に確かめる 絶対確実な方法はない。\fInoexec\fR は SunOS, Solaris, *BSD, Linux, \&\s-1IRIX\s0, Tru64 \s-1UNIX\s0, MacOS X, HP-UX 11.x で使えるはずだ。 \&\s-1AIX\s0 と UnixWare では使えないことがわかっている。環境変数 \&\f(CW\*(C`LD_PRELOAD\*(C'\fR をサポートしているたいていの OS なら、 \&\fInoexec\fR が使えると思う。使用しているオペレーティングシステムの マニュアルページを調べて、ダイナミック・リンカについて (通例 ld.so, ld.so.1, dyld, dld.sl, rld, loader といった名前になっている) \&\f(CW\*(C`LD_PRELOAD\*(C'\fR がサポートされているかどうか確認してほしい。 .Sp .\"O To enable \fInoexec\fR for a command, use the \f(CW\*(C`NOEXEC\*(C'\fR tag as documented .\"O in the User Specification section above. Here is that example again: あるコマンドに対して \fInoexec\fR を有効にするには、 上記「ユーザの設定」セクションで述べたように、\f(CW\*(C`NOEXEC\*(C'\fR タグを 使用する。そのときの例を再掲しよう。 .Sp .Vb 1 \& aaron shanty = NOEXEC: /usr/bin/more, /usr/bin/vi .Ve .Sp .\"O This allows user \fBaaron\fR to run \fI/usr/bin/more\fR and \fI/usr/bin/vi\fR .\"O with \fInoexec\fR enabled. This will prevent those two commands from .\"O executing other commands (such as a shell). If you are unsure .\"O whether or not your system is capable of supporting \fInoexec\fR you .\"O can always just try it out and see if it works. .\"O .PP この例では、ユーザ \fBaaron\fR 対して、\fInoexec\fR を有効にした上で、 \&\fI/usr/bin/more\fR と \fI/usr/bin/vi\fR の実行を許可している。 このようにすれば、この二つのコマンドから (シェルのような) ほかのコマンドを 実行することができなくなるわけだ。使用しているシステムが \fInoexec\fR に 対応する能力があるかどうか、よくわからない場合は、取りあえず \&\fInoexec\fR を試して、効果があるかどうか確かめてみればよい。それなら いつだってできるはずだ。 .PP .\"O Note that restricting shell escapes is not a panacea. Programs .\"O running as root are still capable of many potentially hazardous .\"O operations (such as changing or overwriting files) that could lead .\"O to unintended privilege escalation. In the specific case of an .\"O editor, a safer approach is to give the user permission to run .\"O \&\fBsudoedit\fR. 注意してほしいが、シェル・エスケープの禁止は万能薬ではない。ルートの権限で 動いているプログラムには、ほかにも、危険性のあるさまざまな作業 (ファイルの 中身を入れ替えるとか、上書きするとか) が可能であり、思いがけずに 権限を拡大してしまうこともありえるのだ。特にエディタについて言うと、 ユーザには \fBsudoedit\fR を実行する許可を与えるのが、より安全な方法である。 .\"O .SH "SEE ALSO" .SH "関連項目" .IX Header "SEE ALSO" \&\fIrsh\fR\|(1), \fIsu\fR\|(1), \fIfnmatch\fR\|(3), \fIglob\fR\|(3), \fIsudo\fR\|(8), \fIvisudo\fR\|(8) .\"O .SH "CAVEATS" .SH "警告" .IX Header "CAVEATS" .\"O The \fIsudoers\fR file should \fBalways\fR be edited by the \fBvisudo\fR .\"O command which locks the file and does grammatical checking. It is .\"O imperative that \fIsudoers\fR be free of syntax errors since \fBsudo\fR .\"O will not run with a syntactically incorrect \fIsudoers\fR file. .\"O .PP \&\fIsudoers\fR ファイルの編集には、\fB必ず\fR \fBvisudo\fR コマンドを 使うべきだ。そうすれば、\fBvisudo\fR がファイルをロックし、文法のチェッ クをやってくれる。\fIsudoers\fR ファイルに文法的な間違いがあると、 \&\fBsudo\fR が動かないので、\fIsudoers\fR ファイルには文法エラーが絶 対にあってはならないのだ。 .PP .\"O When using netgroups of machines (as opposed to users), if you .\"O store fully qualified hostnames in the netgroup (as is usually the .\"O case), you either need to have the machine's hostname be fully qualified .\"O as returned by the \f(CW\*(C`hostname\*(C'\fR command or use the \fIfqdn\fR option in .\"O \&\fIsudoers\fR. ネットグループを (ユーザについてではなく) マシンについて使用し、 \&\fInetgroup\fR ファイルに完全修飾ホスト名を記載する場合は (たいてい そうするものだが)、そのマシンのホスト名を \f(CW\*(C`hostname\*(C'\fR コマンドが出力する通りの完全修飾名で書くか、さもなければ \&\fIsudoers\fR ファイルで \fIfqdn\fR オプションを使うかしなければなら ない。 .\"O .SH "BUGS" .SH "バグ" .IX Header "BUGS" .\"O If you feel you have found a bug in \fBsudo\fR, please submit a bug report .\"O at http://www.sudo.ws/sudo/bugs/ \&\fBsudo\fR にバグを発見したと思ったら、下記のページにアクセスして、 バグレポートを提出していただきたい。 .br http://www.sudo.ws/sudo/bugs/ .\"O .SH "SUPPORT" .SH "サポート" .IX Header "SUPPORT" .\"O Limited free support is available via the sudo-users mailing list, .\"O see http://www.sudo.ws/mailman/listinfo/sudo\-users to subscribe or .\"O search the archives. ある程度の無料サポートが sudo-users メーリングリストを通して利用できる。 購読やアーカイブの検索には下記 URL を御覧になること。 .br http://www.sudo.ws/mailman/listinfo/sudo\-users .\"O .SH "DISCLAIMER" .SH "免責" .IX Header "DISCLAIMER" .\"O \&\fBsudo\fR is provided ``\s-1AS\s0 \s-1IS\s0'' and any express or implied warranties, .\"O including, but not limited to, the implied warranties of merchantability .\"O and fitness for a particular purpose are disclaimed. See the \s-1LICENSE\s0 .\"O file distributed with \fBsudo\fR or http://www.sudo.ws/sudo/license.html .\"O for complete details. \&\fBsudo\fR は「現状のまま」提供される。明示的な、あるいは黙示的な いかなる保証も、商品性や特定目的への適合性についての黙示的な保証を含め、 またそれのみに止まらず、これを否認する。詳細な全文については、 \&\fBsudo\fR と一緒に配布されている \s-1LICENSE\s0 ファイルや 下記 Web ページを御覧いただきたい。 .br http://www.sudo.ws/sudo/license.html