Hi.
I am making a tool page for a few servers. In order to start some things up, we now use the shell commands using SSH. What we plan is to have one tool page on the main server. That can start those, so people can start those. I need a way to connect and generate these shell commands from the PHP script.
Is there a class for SSH connection for PHP? Or how can I do this?
L
SSH in PHP script.
Moderator: General Moderators
most intuitive way would be to call command line ssh client via [php_man]shell_exec[/php_man], like this:
Code: Select all
//.......
$output = shell_exec('ssh -i /path/to/cert.file someone@example.com command_to_execute');
//.......