I have one file example.tgz
hosted in one linux server and I want to copy this file (example.tgz
) to another linux server.
How can we copy example.tgz
file from one server to another server please suggest.
I have one file example.tgz
hosted in one linux server and I want to copy this file (example.tgz
) to another linux server.
How can we copy example.tgz
file from one server to another server please suggest.
Try This code:
<?php
$connection = ssh2_connect('otherserver.com', 22);
ssh2_auth_password($connection, 'username', 'password');
ssh2_scp_send($connection, '/local/example.tgz', '/remote/example.tgz', 0644);
?>
Please run this code from local, it copy example.tgz files into /remote/ folder.