사이트 내 전체검색
PHP
php에서 ssh2로 서버간 파일 복사하기
로빈아빠
https://cmd.kr/php/802 URL이 복사되었습니다.

본문

가끔 직접쉘 접속이나 ftp 등을 안쓰고 파일을 옴겨야 할때 씁니다
 
파일이 있는 서버에  move.php 를 생성하여 소스를 넣습니다
 
//target ip
$connection = ssh2_connect('111.111.111.111', 22);
ssh2_auth_password($connection, 'test', '1234');
 
ssh2_scp_send($connection, '/경로/옴길파일명', '/복사될경로/복사될파일명', 0644); //644는 퍼미션

댓글목록

등록된 댓글이 없습니다.

PHP
871 (4/18P)

Search

Copyright © Cmd 명령어 3.14.251.243