Hello:
I am facing an issue and I seem not to be able to find my way out of it.
When I send the ssh command to the localhost, it works, but when sending it to a different server, it doesn’t. I can ssh into the units manually and send the commands manually, but no using the PHP Form depicted here…
The form collects the server name and the command to send, then opens the PHP file to execute the ssh commands to the specified server and command.
What am I doing wrong??
Please help
Here is the two pieces of code…
-=-=-=-=-=-=-=-=
Maintenance ToolMaintenance Tool
Main Units:
Unit name: (Do not use capital letters)Send command:
reboot
Quit Safari
Documents Full
-=-=-==-=-=-=-=-==-=-=-=-=-=-==-=-= <?php $Mplayer = $_POST["player"]; $command = $_POST["radio"]; ?>
You are about to modify the
<?php echo "$Mplayer"; ?>player by sending the
<?PHP $selected_radio = $command; print $selected_radio; $connection = ssh2_connect($Mplayer, 22); ssh2_auth_password($connection, 'user', 'password'); $stream = ssh2_exec($connection, $command); print $stream; ?> command.