REXEC(1) REXEC(1)
名前
rexec -- exec サーバのためのリモート実行クライアント
書式
rexec [ -a -c -d -h -n -s ] [--] host command
説明
rexec は、リモートホスト上の rexecd(8) サーバのクライアントとして動作す
るために rexec(3) ルーチンを呼び出す。
このプログラムは、ユーザー名とパスワードによる認証を使い、ホスト計算 機
上 で ‘‘command’’ を実行するように要求する。プロトコルの詳細は rexec(3)
と rexecd(8) を参照すること。
オプション
rexec は以下のオプションを受け付ける。
-a
コマンドからの標準エラーに対して補助的な (auxiliary) チャンネ ル
を設定しない。つまり、リモートの標準エラーと標準出力の両方がロー
カルの標準出力に返される。デフォルトでは、 rexec はリモートコ マ
ンドからの対話出力に対して別々のチャンネルを設定するように要求す
る。
-c
ローカルの標準入力が閉じられた場合でも、リモートの標準入力を閉じ
ない。通常、ローカルの標準入力が閉じられた場合は、リモートの標準
入力も閉じられる。
-d
デバッグ情報を表示する。特に、リモートホストに送られたコマンドは
エコーされる。
-h
使用法についてのメッセージを表示する。
-n
明示的にユーザー名とパスワードを要求する。このオプションが指定さ
れない場合、ログイン情報として $HOME/.netrc を調べる。
-s
リモートプロセスに対して rexec が受け付けたシグナルを送らない 。
通常、捕捉されたシグナルはリモートプロセスに渡される。これにより
、CNTRL-C を入力した場合にリモートプロセスも終了する。
--
rexec が ‘‘command’’ のオプションに切り替えるためのオプション 終
了の印。
と ても役立つオプションは -n だけである。 $HOME/.netrc にパスワードを設
定していない場合でも、パスワードを要求するプロンプトを出してくれる。
例
rexec othermachine -- cat ">remote_file; date" REXEC(3) Linux Programmer’s Manual REXEC(3)
NAME
rexec - return stream to a remote command
SYNOPSIS
int rexec(char **ahost, int inport, char *user,
char *passwd, char *cmd, int *fd2p);
DESCRIPTION
This interface is obsoleted by rcmd(3).
The rexec() function looks up the host *ahost using gethostbyname(3),
returning -1 if the host does not exist. Otherwise *ahost is set to
the standard name of the host. If a username and password are both
specified, then these are used to authenticate to the foreign host;
otherwise the environment and then the user’s .netrc file in his home
directory are searched for appropriate information. If all this fails,
the user is prompted for the information.
The port inport specifies which well-known DARPA Internet port to use
for the connection; the call getservbyname("exec", "tcp") (see getser-
vent(3)) will return a pointer to a structure that contains the neces-
sary port. The protocol for connection is described in detail in rex-
ecd(8).
If the connection succeeds, a socket in the Internet domain of type
SOCK_STREAM is returned to the caller, and given to the remote command
as stdin and stdout. If fd2p is non-zero, then an auxiliary channel to
a control process will be setup, and a descriptor for it will be placed
in *fd2p. The control process will return diagnostic output from the
command (unit 2) on this channel, and will also accept bytes on this
channel as being Unix signal numbers, to be forwarded to the process
group of the command. The diagnostic information returned does not
include remote authorization failure, as the secondary connection is
set up after authorization has been verified. If fd2p is 0, then the
stderr (unit 2 of the remote command) will be made the same as the std-
out and no provision is made for sending arbitrary signals to the
remote process, although you may be able to get its attention by using
out-of-band data.
CONFORMING TO
Not in POSIX.1-2001. Present on the BSDs, Solaris, and many other sys-
tems. The rexec() function appeared in 4.2BSD.
BUGS
The rexec() function sends the unencrypted password across the network.
The underlying service is considered a big security hole and therefore
not enabled on many sites, see rexecd(8) for explanations.
SEE ALSO
rcmd(3), rexecd(8)
COLOPHON
This page is part of release 3.22 of the Linux man-pages project. A
description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
Linux 2007-12-28 REXEC(3)
Copyright(C) linux-cmd.com All Rights Reserved. Author Takayuki Yukawa