rcp - リモートファイルコピー
rcp [-p] filename1 filename2
rcp [-pr] filename... directory
![]() | 注意 - All data exchanges over this protocol are performed without encryption, and have no protection against spoofing or snooping of traffic.The in.rshd server is disabled by default on Oracle Solaris and most other modern operating systems, and both the in.rshd server and the rcp command may be removed in future versions of Oracle Solaris.Use of the scp(1) or sftp(1) utilities is strongly recommended instead. |
rcp コマンドは、マシン間でファイルをコピーします。filename 引数、directory 引数にリモートファイルを指定する場合は、次のような書式を使用します。
hostname:path
ローカルファイルを指定する場合は、コロン (:) を使用しないか、コロンの前にスラッシュ (/) を付けます。
hostname には、IPv4 または IPv6 のアドレス文字列を指定できます (inet(4P), inet6(4P) を参照)。IPv6 のアドレスにはコロンが含まれているので、hostname を角括弧で囲む必要があります。hostname を角括弧で囲まないと、最初のコロンが hostname と path の区切り文字と見なされてしまいます。For example,
[1080::8:800:200C:417A]:tmp/file
また、フルパス名を指定しないと、filename はホスト (hostname) 上のホームディレクトリから見た相対パスと解釈されます。リモートホスト上のパス名と解釈させるには、パス名 (path) を \ 、" 、 ' などで囲みます。
rcp コマンドの使用時、パスワードを入力する必要はありません。It uses your current local user name, which must be accepted on hostname to allow remote command execution by rsh(1).
rcp では、ソースファイルもターゲットファイルも現在のマシン上に存在しないような「サードパーティコピー」も処理できます。ホスト名は、次の形式になります。
username@hostname:filename
to use username rather than your current local user name as the user name on the remote host.filename にフルパス名を指定しないと、username に指定したリモートホスト上のユーザーのホームディレクトリから見た相対アドレスと解釈されます。
サポートしているオプションは、次のとおりです。
必要に応じて、各コピーに、オリジナルのファイルと同じ変更時間、アクセス時間、モード、ACL を設定します。
指定された filename のサブツリーをコピーします。この場合、コピー先はディレクトリでなければなりません。
次の終了ステータスが返されます。
すべてのファイルを正常にコピーしました。
An error occurred.
終了コードの注意点に関する「ノート」の項を参照してください。
属性についての詳細は、マニュアルページの attributes(7) を参照してください。
|
cpio(1), ftp(1), rlogin(1), rsh(1), rsync(1), scp(1), sftp(1), tar(1), inet(4P), inet6(4P), ip6(4P), hosts.equiv(5), attributes(7), in.rshd(8)
rcp の目的は、別々のホスト間でファイルをコピーすることです。このため、たとえば次のような指定で、あるファイルをそのファイル自体にコピーしようとすると、
example% rcp tmp/file myhost:/tmp/file
ファイルが壊れてしまいます。
コピーの対象がディレクトリではなくファイルである場合、rcp が正常に失敗しないことがあります。
rcp can become confused by output generated by commands in a $HOME/.profile or other shell startup file on the remote host.
rcp でサードパーティコピーを行うには、ソースホストがリモートホスト上で コマンドを実行することを許可されていなければなりません。
rcp では、シンボリックリンクの処理が正しく行われません。Use rsync(1), or tar(1) or cpio(1) piped to ssh to obtain remote copies of directories containing symbolic links or named pipes.
リモートホストを指定する際のメタキャラクタを引用符で囲まないと、解釈不可を示すエラーメッセージが出力されます。
ACL をサポートしていないファイルシステムに ACL をコピーすると、rcp は失敗します。
rcp は、ユーザー名、ホスト名、ドメインの処理を除いて CSI 対応が可能です。
どちらか一方のリモートマシンで Solaris を実行していない場合に、rcp を使用してサードパーティコピーを実行するとき、その終了コードは信頼できません。つまり、終了コードが正常終了を示していても、エラーが発生している可能性があります。あるいは、終了コードが異常終了を示していても、コピーは完全に成功している可能性があります。
このテクノロジは、Oracle Solaris の将来のリリースで削除される可能性があります。
Support for Kerberos, including the options –a, –k, –K, –PN, –PO, and –x, was added in Solaris 10 3/05 and removed in Oracle Solaris 11.4.0.Prior to Solaris 10, a kerberized version was available in the Sun Enterprise Authentication Mechanism (SEAM) add-on package for Solaris.
Support for IPv6 was added in Solaris 8.
The rcp command, including support for the options –p and –r, has been present since the initial release of Solaris.