PuTTY スイートには、マシン間でファイルを安全にコピーするための 2 つのプログラムが含まれています。 PSCP は scp によく似た非対話型プログラムであり、PSFTP は ftp に触発された対話型プログラムです。 Windows XP コマンド プロンプトでは、pscp (セキュア コピー) および psftp (セキュア FTP) を使用できます。 pscp でファイルをコピーするには、以下を使用します:
pscp username @ host:path"
例:
pscp file.txt [email protected]:MyDocuments/.
pscp をいじっていたら、エラーが発生しました:
ssh_init: Network error: Cannot assign requested address
1. pscp はデフォルトでポート 0 を使用しているようで、ファイルのコピーが許可されているポートについて言及しています。
C:\temp>pscp myfie.txt [email protected]:/home/test/ ssh_init: Network error: Cannot assign requested address
2. そこで、コマンド ラインで「-P」オプションを使用してポート番号を指定してみます。
C:\temp>pscp -P 22 myfie.txt [email protected]:/home/test/ The server's host key is not cached in the registry. You have no guarantee that the server is the computer you think it is. The server's ssh-ed25519 key fingerprint is: ssh-ed25519 255 45:35:11:23:5d:10:e2:e3:60:6a:c9:06:bb:74:ad:34 If you trust this host, enter "y" to add the key to PuTTY's cache and carry on connecting. If you want to carry on connecting just once, without adding the key to the cache, enter "n". If you do not trust this host, press Return to abandon the connection. Store key in cache? (y/n) yes [email protected]'s password: myfie.txt | 0 kB | 0.0 kB/s | ETA: 00:00:00 | 100% C:\temp>
うまくいきました。
結論
Linux から Windows システムにファイルを「ダウン」コピーする場合は、Windows 上で動作するプログラムが必要です。 PuTTY の作成者は、Windows に scp を実装するというまさにその目的のために PSCP.EXE を作成しました。