im using a ssh connection to a server, and i would like to know if there ia a command to upload files, like the put on the sftp connection.
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');
}
thanks a lot
You can send files via SSH using SCP
http://php.net/manual/en/function.ssh2-scp-send.php