Jump to content

SFTP via exec


l0ve2hat3

Recommended Posts

well thanks for all the help!

 

i founnd my solution:

 

<?php 
$server = "0.0.0.0";  //valid IP 
$username = "username"; //valid User Name 
$password = "Password"; //valid Password 
$connection = ssh2_connect($server, 22); 
// use any of the ssh2_auth_* methods 
ssh2_auth_password($connection,$username, $password); 
$sftp = ssh2_sftp($connection); 
$dir = "ssh2.sftp://$sftp/a/"; 
$dh = opendir($dir); 
while (false !== ($file = readdir($dh))){ 
echo "$file <br>"; 
} 
closedir($dh); 
?> 

Link to comment
https://forums.phpfreaks.com/topic/120569-sftp-via-exec/#findComment-621465
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.