rpcclient — クライアント側の MS-RPC 関数を発行するツール
rpcclient
[-A authfile] [-c <command string>] [-d debuglevel] [-h] [-l logdir] [-N] [-s <smb config file>] [-U username[%password]] [-W workgroup] [-N] [-I destinationIP] {server}
このツールは samba(7) システムの一部である。
rpcclient
は Samba の MS-RPC
機能をテストするために開発されたユーティリティであり、
開発と安定を何度か繰り返している。
多数のシステム管理者がこのツールを用いて UNIX ワークステーションから
Windows NT クライアントを管理するスクリプトを作成している。
接続先のサーバを NetBIOS 名で指定する。 サーバは SMB/CIFS サーバである必要がある。 この名前の解決には smb.conf(5 ) ファイルの name resolve order パラメータが用いられる。
実行するコマンド (以下で記述) をセミコロンで区切って指定する。
IP address
は接続先の
サーバのアドレスを指定する。記述方法は、標準的な "a.b.c.d"
のフォーマットで指定する。
通常、クライアントは上記の name resolve order
パラメータで指定された名前解決の機能を使用して
NetBIOS 名を検索し、SMB/CIFS サーバを特定する。
このパラメータを使用することで、クライアントに対し強制的に
指定された IP Address にサーバがあると認識させ、接続しようとしているリソースの
NetBIOS 名を無視させることができる。
このパラメータにデフォルトの値はない。 もしこの値が指定されていないのなら、上で述べたようにクライアントが 自動的に判別する。
level
is an integer
from 0 to 10. The default value if this parameter is
not specified is 0.
The higher this value, the more detail will be logged to the log files about the activities of the server. At level 0, only critical errors and serious warnings will be logged. Level 1 is a reasonable level for day-to-day running - it generates a small amount of information about operations carried out.
Levels above 1 will generate considerable amounts of log data, and should only be used when investigating a problem. Levels above 3 are designed for use only by developers and generate HUGE amounts of log data, most of which is extremely cryptic.
Note that specifying this parameter here will
override the parameter
in the smb.conf
file.
Prints the program version number.
The file specified contains the
configuration details required by the server. The
information in this file includes server-specific
information such as what printcap file to use, as well
as descriptions of all the services that the server is
to provide. See smb.conf
for more information.
The default configuration file name is determined at
compile time.
Base directory name for log/debug files. The extension
".progname"
will be appended (e.g. log.smbclient,
log.smbd, etc...). The log file is never removed by the client.
If specified, this parameter suppresses the normal password prompt from the client to the user. This is useful when accessing a service that does not require a password.
Unless a password is specified on the command line or this parameter is specified, the client will request a password.
If a password is specified on the command line and this option is also defined the password on the command line will be silently ingnored and no password will be used.
Try to authenticate with kerberos. Only useful in an Active Directory environment.
Try to use the credentials cached by winbind.
This option allows you to specify a file from which to read the username and password used in the connection. The format of the file is
username = <value> password = <value> domain = <value>
Make certain that the permissions on the file restrict access from unwanted users.
Sets the SMB username or username and password.
If %password is not specified, the user will be prompted. The
client will first check the USER
environment variable, then the
LOGNAME
variable and if either exists, the
string is uppercased. If these environmental variables are not
found, the username GUEST
is used.
A third option is to use a credentials file which
contains the plaintext of the username and password. This
option is mainly provided for scripts where the admin does not
wish to pass the credentials on the command line or via environment
variables. If this method is used, make certain that the permissions
on the file restrict access from unwanted users. See the
-A
for more details.
Be cautious about including passwords in scripts. Also, on
many systems the command line of a running process may be seen
via the ps
command. To be safe always allow
rpcclient
to prompt for a password and type
it in directly.
This option allows you to override
the NetBIOS name that Samba uses for itself. This is identical
to setting the parameter in the smb.conf
file.
However, a command
line setting will take precedence over settings in
smb.conf
.
This specifies a NetBIOS scope that
nmblookup
will use to communicate with when
generating NetBIOS names. For details on the use of NetBIOS
scopes, see rfc1001.txt and rfc1002.txt. NetBIOS scopes are
very rarely used, only set this parameter
if you are the system administrator in charge of all the
NetBIOS systems you communicate with.
Set the SMB domain of the username. This overrides the default domain which is the domain defined in smb.conf. If the domain specified is the same as the servers NetBIOS name, it causes the client to log on using the servers local SAM (as opposed to the Domain SAM).
TCP socket options to set on the client
socket. See the socket options parameter in
the smb.conf
manual page for the list of valid
options.
Print a summary of command line options.
info policy を問い合わせる。
リストされた SID からユーザ名を解決する。
リストされたユーザ名から SID を解決する。
信頼するドメインの一覧を表示する。
ユーザ権利の一覧を表示する。
ユーザ権利の名前を取得する。
LSA の SID の一覧を表示する。
指定した SID の持つユーザ権利を一覧表示する。
指定されたユーザ権利を持つ SID を一覧表示する。
指定されたユーザ権利を持つアカウントを一覧表示する。
アカウントにユーザ権利を追加する。
アカウントからユーザ権利を取り除く。
ユーザ権利の名前から値を取得する。
LSA セキュリティオブジェクトを問い合わせる。
プライマリドメインの情報を取得する。
DFS
DFS をサポートしているか問い合わせる。
DFS の共有を追加する。
DFS の共有を削除する。
DFS の共有の情報を問い合わせる。
DFS の共有の一覧を表示する。
サーバ情報を問い合わせる。
共有を一覧表示する。
開いているファイルを一覧表示する。
リモートサーバの時間を取得する。
ユーザ情報を問い合わせる。
グループ情報を問い合わせる。
ユーザが所属するグループを問い合わせる。
グループに所属するメンバーを問い合わせる。
エイリアスに所属するメンバーを問い合わせる。
ユーザ情報の一覧を表示する。
ドメイン情報を問い合わせる。
ドメインユーザを一覧表示する。
ドメイングループを一覧表示する。
エイリアスグループ(ローカルグループ)を一覧表示する。
ドメインユーザを作成する。
名前を検索する。
rid を検索する。
ドメインユーザを削除する。
SAMR セキュリティオブジェクトを問い合わせる。
ドメインパスワード情報を取得する
ドメイン情報を検索する
プリンタドライバ情報をサーバに登録するために AddPrinterDriver() RPC
の呼び出しを行なう。ドライバファイルは getdriverdir
コマンドが返却するディレクトリ中に予め存在している必要が
ある。arch
に設定できる値は
getdriverdir
コマンドで取得できる値と同じである。
config
パラメータでは以下の形式のファイルを
指定する。
Long Printer Name:\ Driver File Name:\ Data File Name:\ Config File Name:\ Help File Name:\ Language Monitor Name:\ Default Data Type:\ Comma Separated list of Files
空のフィールドには、"NULL" という文字列を指定しておくこと。
Samba は Print Monitor 機能をサポートする必要がない。 これは、この機能が双方向通信を利用するドライバを使うローカルプリンタにしか関係しないためである。 このフィールドは必ず「NULL」にしておくこと。 遠隔の NT プリントサーバにコマンドを発行する場合、 ドライバの Print Monitor 機能をドライバの追加前にインストールしていないと、 RPC に失敗する。
version
パラメータにより、プリンタドライバのバージョン番号が指定される。
省略した場合、アーキテクチャに応じたバージョンが用いられる。
このオプションは Windows 2000 (バージョン 3)のプリンタドライバのアップロードに用いることができる。
遠隔のサーバ上にプリンタを追加する。このプリンタは自動的に共有される。
このコマンドを実行する前に、プリンタドライバをサーバ上にインストール
して (adddriver
を参照のこと)、port
を有効なポート名にしておく (enumports
を参照) 必要があることに注意。
指定されたプリンタドライバについて、すべてのアーキテクチャ用のものを削除する。これは、 ドライバのファイル自体をサーバから削除するわけではなく、 サーバのドライバのリストからエントリだけを削除するものである。
指定されたプリンタドライバについて、ドライバファイルも含めて削除する。 削除対象のバージョンやアーキテクチャを指定することも可能である。 アーキテクチャが指定されなかった場合、すべてのドライバファイルが削除される。
サーバ上に格納されているプリンタの設定情報を一覧表示する。Windows NT クライアントの場合、 これらの情報はレジストリに格納されているが、Samba サーバの場合、 プリンタ用の TDB ファイル中に格納されている。このコマンドは、 Microsoft Platform SDK 中にある GetPrinterData() 関数に相当する。 (このコマンドは現在実装されていない)
キーに基づいたプリンタの情報を表示する。
指定されたプリンタのジョブおよびその状況を表示する。 このコマンドは、Microsoft Platform SDK 中の EnumJobs() 関数に相当する。
プリンタキーを 一覧表示する。
指定された info level でEnumPorts() 関数を呼び出す。現在、info level 1 と 2 のみがサポートされている。
EnumPrinterDrivers() を実行する。これは全てのアーキテクチャ用の インストールされたドライバの一覧を表示する。フラグとオプションの 詳細については、Microsoft Platform SDK のドキュメントを参照のこと。 現在、info level 1, 2, 3 のみがサポートされている。
EnumPrinters() を実行する。これは共有されている インストール済プリンタの一覧を表示する。フラグとオプションの詳細に ついては、Microsoft Platform SDK のドキュメントを参照のこと。 現在、info level 1, 2, 5 のみがサポートされている。
指定されたプリンタの設定情報を取得する。
詳細な情報に付いては、enumdata
コマンドを参照のこと。
このコマンドは Microsoft Platform SDK 中の GetPrinterData()
に相当するものである。
キー名に基づいた プリンタドライバのデータを取得する。
指定されたプリンタのプリンタドライバの情報 (ドライバファイル、 設定ファイル、関連するファイルなど) を取得する。このコマンドは Microsoft Platform SDK 中の GetPrinterDriver() に相当するものである。 現在、info level 1, 2, 3 のみがサポートされている。
GetPrinterDriverDirectory() RPC を発行して、SMB 共有名と指定された
アーキテクチャ用のプリンタドライバの格納されているサブディレクトリを
取得する。arch
に指定できる値は、 "Windows 4.0"
(for Windows 95/98), "Windows NT x86", "Windows NT PowerPC",
"Windows Alpha_AXP", "Windows NT R4000" である。
現在のプリンタ情報を取得する。このコマンドは Microsoft Platform SDK の GetPrinter() に相当する。
print processor ディレクトリを取得する。
指定したプリンタに対して、OpenPrinterEx() と ClosePrinter() RPC を実行する。
SetPrinter() コマンドを実行して、既にインストール されているプリンタ用のプリンタドライバを更新する。 更新されるプリンタドライバは、プリントサーバ上に適切にインストール されている必要がある。
インストールされているプリンタやドライバの一覧を取得する方法に
ついては enumprinters
や enumdrivers
コマンドも参照のこと。
フォームを追加する。
フォームを設定する。
フォームを取得する。
フォームを削除する。
フォームを 一覧表示する。
プリンタのコメントを 設定する。
REG_SZ プリンタデータを設定する。
プリンタ名を設定する。
Rffpcnex テストを実行する。
rpcclient
は開発者のテストツールとしての利用を
念頭に置いているため、あまり動作が安定していない部分
(コマンドラインの解析など) もある。無効なパラメータを解析しようとすると、
失敗してコアダンプするのは既知の不具合である。
Luke Leighton のオリジナルの rpcclient マニュアルページより:
警告! SMB 上の MSRPC コードは ネットワークトレースを行なうことで開発されている。オリジナルの開発者 (Microsoft) からは、SMB 上で MSRPC がどのように動作するか、 個々の MSRPC サービスがどのように動作するかについての情報は提供されていない。 これらのサービスに関する Microsoft の実装も、場所によってはかなり風変わりで あることが明らかになっている。
同様に Samba への実装も場あたり的な面がある。 多くのサービスの実装が解明されるにつれて、smbd (8) や rpcclient(1) は、幾つかのコマンドやサービスにおいてバージョン間の互換性が なくなることもありうる。なお、開発者達は発見した問題を Microsoft に対してレポートしており、報告された問題はサービスパックで修正されているが、 その結果互換性が損なわれることがあるかもしれない。
オリジナルの Samba ソフトウェアと関連するユーティリティは、 Andrew Tridgell によって作成された。現在 Samba は Samba Team によって、 Linux カーネルの開発と同様のオープンソースプロジェクトとして開発が 行なわれている。
オリジナルの rpcclient マニュアルページは Matthew Geddes と Luke Keneth Casson Leighton によって作成され、 Gerald Carter によって書き直された。 Samba 2.2 における DocBook 形式への変換は、Gerald Carter によって行なわれた。Samba 3.0 における DocBook XML 4.2 形式への変換は Alexander Bokovoy によって行われた。