Hey everyone I need a function that is super simple and sends SSH commands from my Web Server with SSH2 extension installed
This is what I use now but SSH2 sucks and is impossible to install
<?php
$method = $_GET['method'];
$command = $_GET['command'];
$serverusername = $_GET['serverusername'];
$serverip = $_GET['serverip'];
$serverpassword = $_GET['serverpassword'];
$serverport = $_GET['serverport'];
if(!($con = ssh2_connect($serverip, $serverport))) die("Failed connecting to backend server.");
if(!ssh2_auth_password($con, $serverusername, $serverpassword)) die("Failed connecting to backend server.");
ssh2_exec($con, $command);
echo "Command sent";
?>
Can I get something similar to that that accepts all these variables
$method = $_GET['method'];
$command = $_GET['command'];
$serverusername = $_GET['serverusername'];
$serverip = $_GET['serverip'];
$serverpassword = $_GET['serverpassword'];
$serverport = $_GET['serverport'];