プロが教えるわが家の防犯対策術!

scpコマンドの-pオプションについて

scpコマンド、(-p)オプションを付加しても
ファイルのオーナ、グループが引き継がれません。
仕様なのでしょうか?
ディストリビューションはRed Hat Enterprise Linux ESです。
よろしくお願いします。

●コピー元
[root@moto tmp]# touch scp-test
[root@moto tmp]# chown dbmgr:dba scp-test
[root@moto tmp]# ls -l scp-test
-rw-r--r-- 1 dbmgr dba 0 2月 16 15:01 scp-test
[root@moto tmp]# chmod 777 scp-test
[root@moto tmp]# ls -l scp-test
-rwxrwxrwx 1 dbmgr dba 0 2月 16 15:01 scp-test
[root@moto tmp]#
[root@moto tmp]# scp -p scp-test saki:/tmp/
scp-test 100% 0 0.0KB/s --:-- ETA
[root@moto tmp]#

●コピー先
[root@saki tmp]# ls -l scp-test
-rwxrwxrwx 1 root root 0 2月 16 2005 scp-test
[root@saki tmp]#

A 回答 (1件)

man scpを実行すると-pオプションは


Preserves modification times, access times, and modes from the original file.
と書いてあります。
変更時間や、アクセス時間、パーミッションは引き継がれるようですが、所有者やグループの情報は引き継がれないようですね。
まぁ、コピー元にいるユーザがコピー先にもいるとは限りませんから、そういう仕様になってると考えるべきでしょう。
    • good
    • 0
この回答へのお礼

なるほど、納得いきました。
ありがとうございます。

お礼日時:2005/02/19 22:30

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!

このQ&Aを見た人はこんなQ&Aも見ています


このQ&Aを見た人がよく見るQ&A