I try to create per PHP SSH2 an txt file with content.
This is the code I tried:
include('Net/SSH2.php');
$ssh = new Net_SSH2('MYIP');
if (!$ssh->login('root', 'MYPASS')) {
exit('Login Failed');
}
if($ssh->exec('cd /var/test/')){
echo $ssh->exec('sudo sh -c \'"text\r\ntest1\r\ntest2" > test.txt\'');
}
unset($ssh);
Is there any way to do that?