.\" .\" Japanese Version Copyright (c) 1997 ISHIOKA Takashi .\" all rights reserved. .\" Translated Mon Sep 8 14:02:18 1997 .\" by ISHIOKA Takashi .\" Mon Feb 9 15:16:20 1998: correction .\" Modified Wed 11 Nov 1998 by NAKANO Takeo .\" Updated & Modified Sat Jan 12 19:02:55 JST 2002 .\" by Yuichi SATO .\" Modified Wed 9 Oct 2002 by NAKANO Takeo .\" Updated & Modified Sun 26 Mar 2006 by Yuichi SATO .\" .TH EXPORTS 5 "28 October 1999" .UC 5 .\"O .SH NAME .\"O exports \- NFS file systems being exported (for Kernel based NFS) .SH 名前 exports \- (カーネルベースの NFS で) エクスポート (export) される NFS ファイルシステム .\"O .SH SYNOPSIS .SH 書式 .B /etc/exports .\"O .SH DESCRIPTION .SH 説明 .\"O The file .\"O .I /etc/exports .\"O serves as the access control list for file systems which may be .\"O exported to NFS clients. It it used by both the NFS mount daemon, .\"O exported to NFS clients. It is used by .\"O .IR exportfs (8) .\"O to give information to .\"O .IR mountd (8) .\"O and to the kernel based NFS file server daemon .\"O .IR nfsd (8). .I /etc/exports ファイルは、 NFS のクライアントにどのファイルシステムをエクスポート (export) してよいか、 というアクセスコントロールリストを与える。 これは .BR exportfs (8) によって使用され、NFS マウントデーモン .BR mountd (8) と、カーネルベースの NFS ファイルサーバデーモン .BR nfsd (8) とに情報を与える。 .PP .\"O The file format is similar to the SunOS .\"O .I exports .\"O file. Each line contains an export point and a whitespace-separated list .\"O of clients allowed to mount the file system at that point. Each listed .\"O client may be immediately followed by a parenthesized, comma-separated .\"O list of export options for that client. No whitespace is permitted .\"O between a client and its option list. このファイルの書式は SunOS の .I exports ファイルと似ている。 それぞれの行には、エクスポートポイントと、 そのポイントにあるファイルシステムをマウントできるクライアントを スペースで区切って指定したリストが書かれている。 リストされたクライアントの直後には、 そのクライアント向けのエクスポートオプションをコンマで区切ってリスト指定し、 リスト全体を括弧で括って置くこともできる。 クライアント名とこのオプションリストとの間にはスペースを入れてはいけない。 .PP .\"O Blank lines are ignored. A pound sign ("#") introduces a comment to the .\"O end of the line. Entries may be continued across newlines using a .\"O backslash. If an export name contains spaces it should be quoted using .\"O double quotes. You can also specify spaces or other unusual character in .\"O the export name using a backslash followed by the character code as three .\"O octal digits. 空行は無視され、# 以降行末まではコメントとみなされる。 行末にバックスラッシュをおけば、エントリは次の行に継続できる。 エクスポート名に空白が含まれる場合は、ダブルクォートで括る。 エクスポートパス名には、 空白やその他通常は使われない文字を指定することもできる。 このような文字を使う場合は、バックスラッシュの後に 3 桁の 8 進数で文字コードを指定する。 .\"O .PP .\"O .SS Machine Name Formats .SS マシン名のフォーマット .\"O NFS clients may be specified in a number of ways: NFS クライアントはいろいろな方法で指定できる。 .\"O .IP "single host .IP "single host" .\"O This is the most common format. You may specify a host either by an .\"O abbreviated name recognized be the resolver, the fully qualified domain .\"O name, or an IP address. これはもっとも普通のフォーマットである。ホストの指定には、 レゾルバが認識できる省略形、FQDN、IP アドレスのどれを用いてもよい。 .\"O .IP "netgroups .IP "netgroups" .\"O NIS netgroups may be given as .\"O .IR @group . .\"O Only the host part of each .\"O netgroup members is consider in checking for membership. Empty host .\"O parts or those containing a single dash (\-) are ignored. NIS のネットグループを .I @group のように与えることができる。ネットグループの各メンバーは、 ホストの部分だけが取り出され、メンバーに入れられる。 ホストの部分が空だったり、単一のダッシュ (\-) だったものは無視される。 .\"O .IP "wildcards .IP ワイルドカード .\"O Machine names may contain the wildcard characters \fI*\fR and \fI?\fR. .\"O This can be used to make the \fIexports\fR file more compact; for instance, .\"O \fI*.cs.foo.edu\fR matches all hosts in the domain .\"O \fIcs.foo.edu\fR. As these characters also match the dots in a domain .\"O name, the given pattern will also match all hosts within any subdomain .\"O of \fIcs.foo.edu\fR. マシン名の指定には、ワイルドカード文字として \fI*\fP と \fI?\fP を 用いることができる。これらを使うと \fIexports\fR ファイルをコンパクトにできる。 例えば \fI*.cs.foo.edu\fR はドメイン \fIcs.foo.edu\fR にあるすべての ホストにマッチする。 これらのワイルドカード文字はドメイン名のドット (.) にもマッチするので、 ここで指定されたパターンは \fIcs.foo.edu\fR の任意のサブドメイン内の 全てのホストにマッチする。 .\"O .IP "IP networks .IP "IP networks" .\"O You can also export directories to all hosts on an IP (sub-) network .\"O simultaneously. This is done by specifying an IP address and netmask pair .\"O as .\"O .IR address/netmask .\"O where the netmask can be specified in dotted-decimal format, or as a .\"O contiguous mask length (for example, either `/255.255.252.0' or `/22' appended .\"O to the network base address result in identical subnetworks with 10 bits of .\"O host). Wildcard characters generally do not work on IP addresses, though they .\"O may work by accident when reverse DNS lookups fail. ディレクトリを IP の (サブ) ネットワークに存在するすべてのホストに 同時にエクスポートすることもできる。 これには IP アドレスとネットマスクのペアを .I address/netmask のように指定すればよい。 ここで netmask は 10 進数をドットで区切って指定することもできるし、 連続するマスクの長さで指定することもできる (例えば、ネットワークベースアドレスに `/255.255.252.0' を追加した場合でも、 `/22' を追加した場合でも、ホスト部が 10 ビットの同じサブネットワークになる)。 ワイルドカード文字は、通常 IP アドレスに対しては動作しない。 ただし DNS の逆引きが失敗すると、たまたま動作してしまうこともあり得る。 '''.TP '''.B =public .\"O '''This is a special ``hostname'' that identifies the given directory name .\"O '''as the public root directory (see the section on WebNFS in .\"O '''.BR nfsd (8) .\"O '''for a discussion of WebNFS and the public root handle). When using this .\"O '''convention, .\"O '''.B =public .\"O '''must be the only entry on this line, and must have no export options .\"O '''associated with it. Note that this does .\"O '''.I not .\"O '''actually export the named directory; you still have to set the exports .\"O '''options in a separate entry. ''' これは特殊な意味を持つ「ホスト名」で、その前に与えられたディレクトリ ''' が public root ディレクトリであることを示す (WebNFS と ''' public root ハンドルの詳細に関しては ''' .BR nfsd (8) ''' の WebNFS のセクションを参照のこと)。この書式を用いる際には、 ''' .B =public ''' がその行での唯一のホスト名エントリでなければならない。また ''' エクスポートオプションを指定してはならない。この指定によって、 ''' ディレクトリが実際にエクスポートされるわけでは\fBない\fPことに ''' 注意すること。エクスポートオプションを、 ''' これとは別のエントリで指定する必要がある。 '''.PP .\"O '''The public root path can also be specified by invoking .\"O '''.I nfsd .\"O '''with the .\"O '''.B \-\-public\-root .\"O '''option. Multiple specifications of a public root will be ignored. ''' public root パスは ''' .I nfsd ''' を ''' .B \-\-public\-root ''' オプションを指定して起動することによっても指定できる。 ''' public root の複数指定は無視される。 .\"O .PP .\"O .SS RPCSEC_GSS security .SS RPCSEC_GSS セキュリティ .\"O To restrict access to an export using rpcsec_gss security, use the special .\"O string "gss/krb5" as the client. It is not possible to simultaneously require .\"O rpcsec_gss and to make requirements on the IP address of the client. エクスポートへのアクセスを rpcsec_gss セキュリティを使って制限するには、 クライアントとして特別な文字列 "gss/krb5" を使うこと。 rpcsec_gss とクライアントの IP アドレスによる資格を 同時に要求することはできない。 .PP .\"O .SS General Options .SS 一般的なオプション .\"O .IR exportfs .\"O understands the following export options: .I exportfs は以下のエクスポートオプションを受け付ける。 .TP .IR secure "\*d .\"O This option requires that requests originate on an internet port less .\"O than IPPORT_RESERVED (1024). This option is on by default. To turn it .\"O off, specify .\"O .IR insecure . このオプションを指定すると、IPPORT_RESERVED (1024) より小さな internet ポートから発したリクエストしか受けつけない。 このオプションはデフォルトで有効になっている。 無効にするには .I insecure と指定する。 .TP .I rw .\"O Allow both read and write requests on this NFS volume. The .\"O default is to disallow any request which changes the filesystem. .\"O This can also be made explicit by using .\"O the .\"O .IR ro " option. この NFS ボリュームに対して、書き込みと読み出しリクエストの両方を許可する。 デフォルトではファイルシステムを変更する全ての書き込みを拒否する (これは .I ro オプションで明示した場合も同じ)。 .TP .I async .\"O This option allows the NFS server to violate the NFS protocol and .\"O reply to requests before any changes made by that request have been .\"O committed to stable storage (e.g. disc drive). このオプションは NFS サーバを NFS プロトコルに違反させ、 あるリクエストによってなされた変更が安定した保存場所 (例えばディスクドライブ) に渡される前に、 そのリクエストに応えるようにする。 .\"O Using this option usually improves performance, but at the cost that .\"O an unclean server restart (i.e. a crash) can cause data to be lost or .\"O corrupted. このオプションを用いると通常は性能が向上するが、 クリーンでないサーバの再起動 (つまりクラッシュ) によってデータが失われたり破壊されうるという代償を伴う。 .\"O In releases of nfs-utils upto and including 1.0.0, this option was the .\"O default. In this and future releases, .\"O .I sync .\"O is the default, and .\"O .I async .\"O must be explicit requested if needed. .\"O To help make system adminstrators aware of this change, 'exportfs' .\"O will issue a warning if neither .\"O .I sync .\"O nor .\"O .I async .\"O is specified. nfs-utils の 1.0.0 まででは、このオプションがデフォルトであった。 このリリース以降は .I sync がデフォルトとなり、 .I async は必要な場合は明示的に指定しなければならない。 システム管理者にこの変更を知らせるため、 .I sync と .I async のいずれも指定されていない場合、`exportfs' は警告を発する。 .TP .I no_wdelay .\"O This option has no effect if .\"O .I async .\"O is also set. The NFS server will normally delay committing a write request .\"O to disc slightly if it suspects that another related write request may be in .\"O progress or may arrive soon. このオプションは同時に .I async が設定されていると効果を持たない。 NFS サーバは、書き込み要求を受けたとき、 関連した別の書き込み要求が実行中である (または近々到着する) と予想した場合、 その要求のディスクへの反映を少し遅らせる。 .\"O This allows multiple write requests to .\"O be committed to disc with the one operation which can improve .\"O performance. If an NFS server received mainly small unrelated .\"O requests, this behaviour could actually reduce performance, so .\"O .IR no_wdelay .\"O is available to turn it off. これにより一度の操作で複数の書き込み要求が ディスクに反映されるので、性能が向上する。 NFS サーバが受け取るデータの書き込み要求が、 主として関連性のない小さなものの場合には、 この動作は実際には性能を低下させてしまうので、 .I no_wdelay を指定して無効にできる。 .\"O The default can be explicitly requested with the .\"O .IR wdelay " option. デフォルトの動作を .I wdelay オプションで明示的に指定することもできる。 .TP .I nohide .\"O This option is based on the option of the same name provided in IRIX .\"O NFS. Normally, if a server exports two filesystems one of which is .\"O mounted on the other, then the client will have to mount both .\"O filesystems explicitly to get access to them. If it just mounts the .\"O parent, it will see an empty directory at the place where the other .\"O filesystem is mounted. That filesystem is "hidden". このオプションは IRIX NFS で提供される同名のオプションを元にしている。 サーバが 2 つのファイルシステムをエクスポートし、 そのうちの 1 つが他方にマウントされている場合、 クライアントが両者にアクセスを行うには、 両方のファイルシステムを明示的にマウントしなければならない。 親の方をマウントしただけでは、 もう一方のファイルシステムがマウントされているディレクトリは空に見える。 このようなファイルシステムは "hidden" といわれる。 .\"O Setting the .\"O .I nohide .\"O option on a filesystem causes it not to be hidden, and an .\"O appropriately authorised client will be able to move from the parent to .\"O that filesystem without noticing the change. hidden にしたくないファイルシステムに .I nohide オプションを設定すれば、 適切な権限のあるクライアントは変更を知らされることなく、 親から子のファイルシステムに移動できる。 .\"O However, some NFS clients do not cope well with this situation as, for .\"O instance, it is then possible for two files in the one apparent .\"O filesystem to have the same inode number. しかし NFS クライアントのなかには、 このような状況 (例えば、見かけ上 1 つのファイルシステムで 2 つのファイルが同じ inode 番号を持つような状況) ではうまく動作しないものもある。 .\"O The .\"O .I nohide .\"O option is currently only effective on .\"O .I "single host .\"O exports. It does not work reliably with netgroup, subnet, or wildcard .\"O exports. .I nohide オプションは現在のところ .I "single host" エクスポートでしか効果がない。 このオプションの動作は、 netgroup, subnet, wildcard などによるエクスポートでは信頼性がない。 .\"O This option can be very useful in some situations, but it should be .\"O used with due care, and only after confirming that the client system .\"O copes with the situation effectively. このオプションは状況によってはとても便利であるが、よく注意して、 かつクライアントシステムがその状況下で効果的に動作することを確認した後で 使うべきである。 .\"O The option can be explicitly disabled with .\"O .IR hide . このオプションは .I hide で明示的に無効にできる。 .TP .I no_subtree_check .\"O This option disables subtree checking, which has mild security .\"O implications, but can improve reliability is some circumstances. このオプションのサブツリーのチェックを無効にする。 これには簡単なセキュリティの意味もあるが、 環境によっては信頼性を向上させることもできる。 .\"O If a subdirectory of a filesystem is exported, but the whole .\"O filesystem isn't then whenever a NFS request arrives, the server must .\"O check not only that the accessed file is in the appropriate filesystem .\"O (which is easy) but also that it is in the exported tree (which is .\"O harder). This check is called the .\"O .IR subtree_check . ファイルシステムのサブディレクトリがエクスポートされているが、 ファイルシステム全体がエクスポートされていない場合、 NFS リクエストがくると、サーバは対応するファイルシステムに アクセスされたファイルがあるかをチェックするだけでなく (これは簡単)、 エクスポートされたツリーのなかにあるかもチェックしなければならない (これは難しい)。 このチェックは .I subtree_check とよばれる。 .\"O In order to perform this check, the server must include some .\"O information about the location of the file in the "filehandle" that is .\"O given to the client. This can cause problems with accessing files that .\"O are renamed while a client has them open (though in many simple cases .\"O it will still work). このチェックを行うには、サーバはクライアントに渡す 「ファイルハンドル」に、ファイルの場所に関する情報を入れなければならない。 こうすると、クライアントがファイルをオープンしている間に、 アクセスしているファイルの名前が変更されると問題が起こる (ただし多くの簡単なケースでは動作する)。 .\"O subtree checking is also used to make sure that files inside .\"O directories to which only root has access can only be accessed if the .\"O filesystem is exported with .\"O .I no_root_squash .\"O (see below), even the file itself allows more general access. サブツリーのチェックは、 ファイルシステムが .I no_root_squash (下記参照) でエクスポートされていて、 ファイル自身にはより一般的なアクセス権がある場合に、 root しかアクセスできないディレクトリ内のファイルが root によってのみアクセスされているかを確認するのにも使える。 .\"O As a general guide, a home directory filesystem, which is normally .\"O exported at the root and may see lots of file renames, should be .\"O exported with subtree checking disabled. A filesystem which is mostly .\"O readonly, and at least doesn't see many file renames (e.g. /usr or .\"O /var) and for which subdirectories may be exported, should probably be .\"O exported with subtree checks enabled. .\"O .\"O exported at the root の意味がよくわからない。 .\"O 一般的な指針として、ホームディレクトリは サブツリーのチェックを無効にしてエクスポートすべきである (通常各ユーザの親ディレクトリのレベルでエクスポートされ、 かつファイル名の変更が多いため)。 大抵は読み込みのみで、ほとんどファイル名の変更が行われない ファイルシステム (たとえば /usr や /var) で、 それらのサブディレクトリがエクスポートされるような場合には、 サブツリーのチェックを有効にしてエクスポートした方がよいかもしれない。 .\"O The default of having subtree checks enabled, can be explicitly .\"O requested with .\"O .IR subtree_check . サブツリーのチェックを行うデフォルトの動作は、 .I subtree_check で明示的に指定することもできる。 .TP .I insecure_locks .TP .I no_auth_nlm .\"O This option (the two names are synonymous) tells the NFS server not to require authentication of .\"O locking requests (i.e. requests which use the NLM protocol). Normally .\"O the NFS server will require a lock request to hold a credential for a .\"O user who has read access to the file. With this flag no access checks .\"O will be performed. このオプション (2 つのオプション名は同じ意味) を指定すると、 NFS はロック要求 (NLM プロトコルを使った要求) の際に認証を必要としなくなる。 通常 NFS サーバは、ファイルの読み取りアクセス権限を持つユーザに対し、 信用証明 (credential) を保持するために、ロック要求を必要とする。 このフラグを指定すると、アクセスチェックが行われない。 .\"O Early NFS client implementations did not send credentials with lock .\"O requests, and many current NFS clients still exist which are based on .\"O the old implementations. Use this flag if you find that you can only .\"O lock files which are world readable. 初期の NFS クライアントの実装ではロック要求の際に信用証明を送らなかったが、 現在でもこのような昔の実装を元にした多くの NFS クライアントが存在する。 全ての人が読み込み可能なファイルのみをロックしたい場合は、 このフラグを使うこと。 .\"O The default behaviour of requiring authentication for NLM requests can .\"O be explicitly requested with either of the synonymous .\"O .IR auth_nlm , .\"O or .\"O .IR secure_locks . NLM 要求の際に認証を求めるデフォルトの動作は、 同じ意味をもつ .I auth_nlm または .I secure_locks のどちらか (意味は全く同じ) で明示的に指定できる。 '''.TP '''.I noaccess .\"O '''This makes everything below the directory inaccessible for the named .\"O '''client. This is useful when you want to export a directory hierarchy to .\"O '''a client, but exclude certain subdirectories. The client's view of a .\"O '''directory flagged with noaccess is very limited; it is allowed to read .\"O '''its attributes, and lookup `.' and `..'. These are also the only entries .\"O '''returned by a readdir. ''' このオプションを付けたクライアントは、そのディレクトリ以下のすべての ''' ファイルに対してアクセスできなくなる。あるディレクトリ階層を ''' クライアントにエクスポートするとき、特定のサブディレクトリを除きたい ''' 場合などに便利である。 noaccess フラグが付いたディレクトリの ''' クライアントからの見え方は、非常に制限されたものとなる。 ''' ディレクトリ属性と、 `.' および `..' の閲覧だけが許される。 ''' readdir に対して返されるエントリもこの 2 つだけになる。 '''.TP '''.IR link_relative .\"O '''Convert absolute symbolic links (where the link contents start with a .\"O '''slash) into relative links by prepending the necessary number of ../'s .\"O '''to get from the directory containing the link to the root on the .\"O '''server. This has subtle, perhaps questionable, semantics when the file .\"O '''hierarchy is not mounted at its root. ''' 絶対パス形式のシンボリックリンクを相対パス形式のリンクに変換する ''' (絶対パス形式とは、リンクの内容が "/" で始まるものである)。 ''' 変換は次のように行われる。 ''' まずリンクが置かれているディレクトリの、サーバのルートからの ''' 深さを取得する。そしてその数だけ '../' を絶対リンクの前に付加する。 ''' マウントポイントのルートからの位置が異なる場合、 ''' この変換には微妙な (おそらく障害の原因となる) あいまいさが ''' 含まれる可能性がある。 '''.TP '''.IR link_absolute .\"O '''Leave all symbolic link as they are. This is the default operation. ''' 全てのシンボリックリンクをそのままにする。 これがデフォルトである。 .\"O .TP .IR mountpoint= path .TP .I mp .\"O This option makes it possible to only export a directory if it has .\"O successfully been mounted. .\"O If no path is given (e.g. .\"O .IR mountpoint " or " mp ) .\"O then the export point must also be a mount point. If it isn't then .\"O the export point is not exported. This allows you to be sure that the .\"O directory underneath a mountpoint will never be exported by accident .\"O if, for example, the filesystem failed to mount due to a disc error. このオプションを使うと、マウントに成功した場合にのみ、 そのディレクトリをエクスポートできる。 パスが指定されない場合 (たとえば .IR mountpoint " または " mp の場合)、エクスポートポイントはマウントポイントでなければならない。 そうでなければ、エクスポートポイントはエクスポートされない。 これにより、マウントポイント以下のディレクトリが、 事故によってエクスポートされてしまわないようにすることができる。 ここでいう事故とは、例えばディスクエラーによって ファイルシステムがマウントに失敗するような場合である。 .\"O If a path is given (e.g. .\"O .IR mountpoint= "/path or " mp= /path) .\"O then the nominted path must be a mountpoint for the exportpoint to be .\"O exported. .\"Osato: .\"Osato: nominted は mounted の間違い? .\"Osato: ここの訳は全体的に自身なし。 .\"Osato: パスが指定される場合 (たとえば .IR mountpoint= "/path または " mp= /path の場合)、マウントされるパスは、 エクスポートされるエクスポートポイントに対応する マウントポイントでなければならない。 .TP .IR fsid= num .\"O This option forces the filesystem identification portion of the file .\"O handle and file attributes used on the wire to be .\"O .I num .\"O instead of a number derived from the major and minor number of the .\"O block device on which the filesystem is mounted. Any 32 bit number .\"O can be used, but it must be unique amongst all the exported filesystems. .\"Osato: .\"Osato: filesystem identification porting が .\"Osato: file handle, file attributes の両方にかかっていると .\"Osato: 考えて訳しているが、正しいか自身なし。 .\"Osato: on the wire の訳は「通信で使われる」でよいか。 .\"Osato: このオプションは、通信で使用されるファイルハンドルとファイル属性の ファイルシステム識別部として、 ファイルシステムがマウントされているブロックデバイスの メジャー番号とマイナー番号から導き出された数ではなく、 .I num を使う。 任意の 32 ビットの数値が使えるが、 エクスポートされるファイルシステム間で一意 (unique) でなければならない。 .\"O This can be useful for NFS failover, to ensure that both servers of .\"O the failover pair use the same NFS file handles for the shared filesystem .\"O thus avoiding stale file handles after failover. これは NFS のフェイルオーバー (failover, 代替引き継ぎ) で役立つ。 フェイルオーバーのペアとなる両方のサーバーが、 共有されるファイルシステムに対して 同じ NFS ファイルハンドルを使うことが保証されるので、 フェイルオーバー後にファイルハンドルが失効するのを避けることができる。 .\"O Some Linux filesystems are not mounted on a block device; exporting .\"O these via NFS requires the use of the .\"O .I fsid .\"O option (although that may still not be enough). Linux のファイルシステムの中には、 ブロックデバイスにマウントされていないものもある。 これらのファイルシステムを NFS でエクスポートするには、 .I fsid オプションを使う必要がある (ただし、このオプションはまだ充分ではない)。 .\"O The value 0 has a special meaning when use with NFSv4. NFSv4 has a .\"O concept of a root of the overall exported filesystem. The export point .\"O exported with fsid=0 will be used as this root. 値 0 は NFSv4 で使う場合には特別な意味を持つ。 NFSv4 にはエクスポートされるファイルシステム全体のルートという概念がある。 fsid=0 でエクスポートされたエクスポートポイントは、 このルートとして使用される。 .\"O .SS User ID Mapping .SS ユーザ ID のマッピング .PP .\"O .I nfsd .\"O bases its access control to files on the server machine on the uid and .\"O gid provided in each NFS RPC request. The normal behavior a user would .\"O expect is that she can access her files on the server just as she would .\"O on a normal file system. This requires that the same uids and gids are .\"O used on the client and the server machine. This is not always true, nor .\"O is it always desirable. サーバマシン上のファイルに対する .I nfsd によるアクセスコントロールは、 それぞれの NFS RPC request の際に与えられる uid と gid に基づいている。 ユーザは通常、 サーバ上にある自分のファイルには、それが普通のファイルシステム上に あるのと同様にアクセス可能であることを期待している。 これにはクライアントとサーバ上で用いられる uid と gid がそれぞれ 同じである必要があるが、 これは常に真であるとは限らず、望ましいとも限らない。 .PP .\"O Very often, it is not desirable that the root user on a client machine .\"O is also treated as root when accessing files on the NFS server. To this .\"O end, uid 0 is normally mapped to a different id: the so-called .\"O anonymous or .\"O .I nobody .\"O uid. This mode of operation (called `root squashing') is the default, .\"O and can be turned off with .\"O .IR no_root_squash . クライアントマシンの root が NFS サーバのファイルにアクセスするとき、 サーバの root として扱われてしまうのは、ほとんどの場合は望ましくない。 このため uid 0 は普通は別の id (anonymous や .I nobody uid) にマッピングされる。 この動作は `root squashing' と呼ばれるが、これがデフォルトである。 .I no_root_squash を使えばオフにすることができる。 .PP .\"O By default, .\"O '''.I nfsd .\"O '''tries to obtain the anonymous uid and gid by looking up user .\"O '''.I nobody .\"O '''in the password file at startup time. If it isn't found, a uid and gid .\"O .I exportfs .\"O chooses a uid and gid .\"O of -2 (i.e. 65534) for squashed access. These values can also be overridden by .\"O the .\"O .IR anonuid " and " anongid .\"O options. デフォルトでは、 ''' .I nfsd ''' は ''' 起動時に password ファイル中の ''' .I nobody ''' ユーザを参照して、 ''' anonymous の uid と gid を得ようとする。 ''' もしそれが見つからない場合には、 .I exportfs は squash アクセスに -2 (つまり 65534) という uid と gid を用いる。 これらの数値は .IR anonuid " と " anongid オプションによって変更できる。 '''.PP .\"O '''In addition to this, .\"O '''.I nfsd .\"O '''lets you specify arbitrary uids and gids that should be mapped to user .\"O '''nobody as well. .\"O Finally, you can map all user requests to the .\"O anonymous uid by specifying the .\"O .IR all_squash " option. ''' これに加え、 ''' .I nfsd ''' によって nobody に割り当てるべき適当な ''' uid と gid とを指定することもできる。 最後に、 .I all_squash オプションを指定すれば、 全ての user request を anonymous uid に割り当てることもできる。 '''.PP .\"O '''For the benefit of installations where uids differ between different .\"O '''machines, .\"O '''.I nfsd .\"O '''provides several mechanism to dynamically map server uids to client .\"O '''uids and vice versa: static mapping files, NIS-based mapping, and .\"O '''.IR ugidd -based .\"O '''mapping. ''' マシンごとに uid が異なるような場合への導入を容易にするため、 ''' .I nfsd ''' ではサーバの uid をクライアントの uid に (あるいはその逆に) ''' 動的にマッピングする手法をいくつか提供している。 ''' 静的なマッピングファイル、 NIS ベースのマッピング、 ''' .I ugidd ''' ベースのマッピング、である。 ''' .PP .\"O '''.IR ugidd -based .\"O '''mapping is enabled with the .\"O '''.I map_daemon .\"O '''option, and uses the UGID RPC protocol. For this to work, you have to run .\"O '''the .\"O '''.IR ugidd (8) .\"O '''mapping daemon on the client host. It is the least secure of the three methods, .\"O '''because by running .\"O '''.IR ugidd , .\"O '''everybody can query the client host for a list of valid user names. You ''' .I ugidd ''' ベースのマッピングは ''' .I map_daemon ''' オプションを指定して UGID RPC プロトコルを使えば可能となる。 ''' このプロトコルを動かすにはクライアントで ''' .IR ugidd (8) ''' mapping デーモンを動作させる必要がある。 ''' これは 3 つある方法の中で、セキュリティ的には最悪である。 ''' なぜなら ''' .I ugidd ''' を動作させると、誰でもクライアントに問い合わせて、有効なユーザ名の ''' リストを入手できてしまうからである。 .\"O '''can protect yourself by restricting access to .\"O '''.I ugidd .\"O '''to valid hosts only. This can be done by entering the list of valid .\"O '''hosts into the .\"O '''.I hosts.allow .\"O '''or .\"O '''.I hosts.deny .\"O '''file. The service name is .\"O '''.IR ugidd . .\"O '''For a description of the file's syntax, please read .\"O '''.IR hosts_access (5). ''' .I ugidd ''' へのアクセスを特定のホストのみに制限して、身を守ることもできる。 ''' これには許可するホストのリストを ''' .I hosts.allow ''' または ''' .I hosts.deny ''' ファイルに記述すればよい。サービス名は ''' .I ugidd ''' である。これらのファイルの文法については、 ''' .IR hosts_access (5) ''' を参照してほしい。 '''.PP .\"O '''Static mapping is enabled by using the .\"O '''.I map_static .\"O '''option, which takes a file name as an argument that describes the mapping. .\"O '''NIS-based mapping queries the client's NIS server to obtain a mapping from .\"O '''user and group names on the server host to user and group names on the .\"O '''client. ''' 静的なマッピングは ''' .I map_static ''' オプションによって動作させることができる。このオプションは、マッピングを ''' 記述したファイルの名前を引数にとる。 ''' NIS ベースのマッピングは、クライアントの NIS サーバに問い合わせて、 ''' サーバのユーザ名・グループ名からクライアントのユーザ名・グループ名への ''' マッピング情報を入手する。 .PP .\"O Here's the complete list of mapping options: 以下にマッピングオプションの完全なリストをあげる: .TP .I root_squash .\"O Map requests from uid/gid 0 to the anonymous uid/gid. Note that this does .\"O not apply to any other uids that might be equally sensitive, such as user .\"O .IR bin . uid/gid が 0 のリクエストを annonymous uid/gid にマッピングする。 このオプションは、 root 以外の uid には適用されない。他にも 注意すべき uid は存在する (例えば .I bin など) ので、注意する必要がある。 .TP .I no_root_squash .\"O Turn off root squashing. This option is mainly useful for diskless clients. root squashing を無効にする。 このオプションは主にディスクレスクライアントにとって便利である。 '''.TP '''.IR squash_uids " and " squash_gids .\"O '''This option specifies a list of uids or gids that should be subject to .\"O '''anonymous mapping. A valid list of ids looks like this: ''' このオプションは、annonymous にマッピングされる uid や gid のリストを ''' 明示するためのものである。 id のリストとしては以下のような指定が有効で ''' ある: '''.IP '''.IR squash_uids=0-15,20,25-50 '''.IP .\"O '''Usually, your squash lists will look a lot simpler. ''' 通常の squash リストはもっとずっと簡単なものになるだろうが。 .TP .I all_squash .\"O Map all uids and gids to the anonymous user. Useful for NFS-exported .\"O public FTP directories, news spool directories, etc. The opposite option .\"O is .\"O .IR no_all_squash , .\"O which is the default setting. 全ての uid とgid を anonymous にマッピングする。 これは NFS エクスポートされた公開 FTP ディレクトリや、 news のスプールディレクトリ等に便利である。 これと逆のオプションは .I no_all_squash であり、こちらがデフォルトになっている。 '''.TP '''.IR map_daemon .\"O '''This option turns on dynamic uid/gid mapping. Each uid in an NFS request .\"O '''will be translated to the equivalent server uid, and each uid in an .\"O '''NFS reply will be mapped the other way round. This option requires that .\"O '''.IR rpc.ugidd (8) .\"O '''runs on the client host. The default setting is .\"O '''.IR map_identity , .\"O '''which leaves all uids untouched. The normal squash options apply regardless .\"O '''of whether dynamic mapping is requested or not. ''' このオプションは 動的な uid/gid のマッピングを有効にする。 ''' NFS request 中のそれぞれの uid はサーバ上の対応する uid に変換され、 ''' NFS reply 中の uid はそれぞれ逆に変換される。 ''' このオプションを用いるには、クライアントホストで ''' .BR rpc.ugidd (8) ''' が動作していることが必要である。 ''' デフォルトでは、全ての uid を変えない ''' .IR map_identity ''' となっている。 ''' 普通の squash オプションは、動的なマッピングか否かを気にすることなく ''' 適用できる。 ''' .TP ''' .IR map_static .\"O '''This option enables static mapping. It specifies the name of the file .\"O '''that describes the uid/gid mapping, e.g. ''' このオプションを指定すると静的なマッピングが可能となる。 ''' uid/gid マッピングが記述されたファイル名を以下のように指定する。 '''.IP '''.IR map_static=/etc/nfs/foobar.map '''.IP .\"O '''The file's format looks like this ''' ファイルのフォーマットは以下のようなものである。 '''.IP '''.nf '''.ta +3i '''# Mapping for client foobar: '''# remote local '''uid 0-99 - # squash these '''uid 100-500 1000 # map 100-500 to 1000-1400 '''gid 0-49 - # squash these '''gid 50-100 700 # map 50-100 to 700-750 '''.fi '''.TP '''.IR map_nis .\"O '''This option enables NIS-based uid/gid mapping. For instance, when .\"O '''the server encounters the uid 123 on the server, it will obtain the .\"O '''login name associated with it, and contact the NFS client's NIS server .\"O '''to obtain the uid the client associates with the name. ''' このオプションを指定すると NIS ベースの uid/gid マッピングが可能となる。 ''' 例えば、サーバが uid 123 の指定を受けると、サーバはまずその uid に ''' 対応するローカルのログイン名を調べる。次に NFS クライアントの NIS サーバに ''' 接続して、そのログイン名に対応する uid を取得する。 '''.IP .\"O '''In order to do this, the NFS server must know the client's NIS domain. .\"O '''This is specified as an argument to the .\"O '''.I map_nis .\"O '''options, e.g. ''' これを行うには、 NFS サーバがクライアントの NIS ドメインを ''' 知っていなければならない。このドメインは ''' .I map_nis ''' オプションの引数として以下のように指定する。 '''.IP '''.I map_nis=foo.com '''.IP .\"O '''Note that it may not be sufficient to simply specify the NIS domain .\"O '''here; you may have to take additional actions before .\"O '''.I nfsd .\"O '''is actually able to contact the server. If your distribution uses .\"O '''the NYS library, you can specify one or more NIS servers for the .\"O '''client's domain in .\"O '''.IR /etc/yp.conf . ''' ただここに NIS ドメインを記述するだけでは、通常は充分ではない。 ''' .I nfsd ''' が NIS サーバにコンタクトできるようにするには、他の作業が必要と ''' なるだろう。利用しているディストリビューションが NYS ライブラリを ''' 使っている場合は、クライアントのドメインのサーバを ''' .I /etc/yp.conf ''' に一つ以上指定する必要があるだろう。 .\"O '''If you are using a different NIS library, you may have to obtain a .\"O '''special .\"O '''.IR ypbind (8) .\"O '''daemon that can be configured via .\"O '''.IR yp.conf . ''' 他の NIS ライブラリを用いている場合には、 ''' .I yp.conf ''' によって設定できるような、特殊な ''' .IR ypbind (8) ''' を入手する必要があるかもしれない。 .TP .\"O .IR anonuid " and " anongid .IR anonuid " および " anongid .\"O These options explicitly set the uid and gid of the anonymous account. .\"O This option is primarily useful for PC/NFS clients, where you might want .\"O all requests appear to be from one user. As an example, consider the .\"O export entry for .\"O .B /home/joe .\"O in the example section below, which maps all requests to uid 150 (which .\"O is supposedly that of user joe). これらのオプションは anonymous アカウントの uid と gid を明示的にセット する。これは、全てのリクエストが一人のユーザからになるような PC/NFS clients にとって主に有効である。 例えば、 以下の「例」のセクションでの .I /home/joe なるエクスポートエントリを見てほしい。 この例では、(joe からのものであると思われる) 全てのリクエストが uid 150 に マッピングされる。 .IP .\"O .SH EXAMPLE .SH 例 .PP .nf .ta +3i # sample /etc/exports file / master(rw) trusty(rw,no_root_squash) /projects proj*.local.domain(rw) /usr *.local.domain(ro) @trusted(rw) /home/joe pc001(rw,all_squash,anonuid=150,anongid=100) /pub (ro,insecure,all_squash) '''/pub/private (noaccess) .fi .PP .\"O The first line exports the entire filesystem to machines master and trusty. .\"O In addition to write access, all uid squashing is turned off for host .\"O trusty. The second and third entry show examples for wildcard hostnames .\"O and netgroups (this is the entry `@trusted'). The fourth line shows the .\"O entry for the PC/NFS client discussed above. Line 5 exports the .\"O public FTP directory to every host in the world, executing all requests .\"O under the nobody account. The .\"O .I insecure .\"O option in this entry also allows clients with NFS implementations that .\"O don't use a reserved port for NFS. .\"O '''The last line denies all NFS clients .\"O '''access to the private directory. 1 行目は、 master と trusty に対してすべてのファイルシステムの マウント許可を出している。 書き込みの許可に加え、さらに trusty に対しては、すべての uid squashing も無効にしている。 2 行目と 3 行目は、ホスト名へのワイルドカードの利用と、ネットグループ (@trusted のエントリ) の例である。 4 行目は、上で述べた PC/NFS クライアント用エントリの例である。 5 行目は、公開 FTP ディレクトリを世界中の全てのホストにエクスポートしている。 すべてのリクエストは nobody アカウントで実行される。 またこのエントリ中の .I insecure オプションによって、 NFS 用 port を使わないように実装された NFS クライアントからのアクセスも許可している。 ''' 最後の行では、 private ディレクトリへのアクセスをすべての ''' クライアントに対して拒否するようにしている。 .\"O '''.SH CAVEATS ''' .SH 警告 .\"O '''Unlike other NFS server implementations, this .\"O '''.I nfsd .\"O '''allows you to export both a directory and a subdirectory thereof to .\"O '''the same host, for instance .\"O '''.IR /usr " and " /usr/X11R6 . ''' 他の NFS サーバの実装と違い、 ''' この ''' .B nfsd ''' では、例えば ''' .IR /usr " と " /usr/X11R6 ''' のように、あるディレクトリとそのサブディレクトリとの両方を ''' 同じホストにエクスポートすることができる。 .\"O '''In this case, the mount options of the most specific entry apply. For .\"O '''instance, when a user on the client host accesses a file in .\"O '''.IR /usr/X11R6 , .\"O '''the mount options given in the .\"O '''.I /usr/X11R6 .\"O '''entry apply. This is also true when the latter is a wildcard or netgroup .\"O '''entry. ''' この場合、特定の度合がもっとも高いエントリのマウントオプションが適用される。 ''' 例えばクライアントホスト上のユーザが ''' .IR /usr/X11R6 ''' のファイルにアクセスする場合は、 ''' .I /usr/X11R6 ''' のエントリであたえられた マウントオプションが適用される。 ''' これはエントリのホスト指定がワイルドカード(wildcard) もしくは netgroup ''' の場合でも真である。 .\"O .SH FILES .SH ファイル /etc/exports .\"O '''.SH DIAGNOSTICS ''' .SH 返り値 .\"O '''An error parsing the file is reported using syslogd(8) as level NOTICE from .\"O '''a DAEMON whenever nfsd(8) or mountd(8) is started up. Any unknown .\"O '''host is reported at that time, but often not all hosts are not yet known .\"O '''to named(8) at boot time, thus as hosts are found they are reported .\"O '''with the same syslogd(8) parameters. ''' .BR nfsd (8) ''' か ''' .BR mountd (8) ''' が起動していれば、 ''' ファイルの解釈中のエラーは常に ''' .BR syslogd (8) ''' を用いて報告される。 ''' DAEMON からの NOTICE レベルとなる。 ''' そのとき、未知のホスト全てが報告される。しかし起動時には ''' .BR named (8) ''' が全てのホストを知らない場合もありうる。 ''' したがってホストが見つかるたびに、それらは ''' .BR syslogd (8) ''' に、同じパラメータで報告される。