Page 1 of 1

Remotely executing a Shell script

Posted: Mon Apr 12, 2004 2:41 pm
by Rahil
I have two servers, one where my website is stored, and one where my shell scripts are stored.

How can a PHP page on my web server, exec a shell script on the other server? I can provide the username, password, and IP. All I need to do is exec a script. Both servers are Linux/UNIX by the way.

Thanks in advance.

Posted: Mon Apr 12, 2004 3:36 pm
by TheBentinel.com
I remember using the command: rcmd on a SCO Unix system. I don't know if it's specific to SCO or not. Worth checking out.

If not that, and you have a web server running on your shell script machine, you could run them through CGI.

Posted: Mon Apr 12, 2004 4:40 pm
by JAM
Very interesting topic. I havn't dealt with this myself, but for the thought of discussion...

What about cURL? It supports telnet so... it should in theory work (?).

Posted: Tue Apr 13, 2004 8:24 pm
by Rahil
I've never used cURL.

It seems like what I want to do is not possible through PHP :(

Posted: Tue Apr 13, 2004 9:33 pm
by Zorth
Wrong thread...