I have one file example.tgz hosted in one linux server and I want to copy this file (example.tgz) to another linux server.
example.tgz
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.
报告相同问题?
程序员都在用的中文IT技术交流社区
专业的中文 IT 技术社区,与千万技术人共成长
关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!