in reply to executing a program

Why do you quote the at-sign and dots inside single quotes? If you want ssh to run a program, separate the hostname from the path by a space.
Using ssh root@... in a CGI application sounds like a security risk.
For printing headers in CGI, it's better to use the header() function.