From a PHP script through a website, run a shell script that ssh’s into another server and runs a command.

I have a LAMP-ish website, that displays data about Linux servers (namely patch status). I have a check box that selects one or several servers and a button. When you check the check box on a server and click the button, it should run a shell script that SSH’s to the server, sets an atd job and displays some status text.

Everything works, except SSH. I have all this setup and the only commands in the shell script that do not execute are the SSH lines.

PHP uses sudo to run the script as root (for SSH key usage and setting atd jobs).

submitted by /u/LaV-Man
[link] [comments]