1

サーバーへのssh接続を使用しています.sftp接続に置くなど、ファイルをアップロードするコマンドがあるかどうかを知りたいです.

include('Net/SSH2.php');
include('Crypt/RSA.php');

$key = new Crypt_RSA();

$key->loadKey(file_get_contents('/pathtokey.pem'));


$ssh = new Net_SSH2('ec2-xxx-xxx-xxx-xxx.compute-1.amazonaws.com');
if (!$ssh->login('user', $key)) {
exit('Login Failed');
}

どうもありがとう

4

1 に答える 1

2

SCPを使用してSSH経由でファイルを送信できます

http://php.net/manual/en/function.ssh2-scp-send.php

于 2012-05-30T19:56:22.120 に答える