Warren,

I use ssh on all of my servers for logging in remotely. My next question would be, how do I connect to the remote server to run commands through PHP? Do I need to setup a socket or something? Could you provide me a pseudo sample or maybe point me to some docs. I've never had to do this type of thing in PHP before and I want to make sure I do it right. Thanks.

Sean

Vail, Warren wrote:

I've done a number of these and the choice depends on many things but
perhaps the biggest factor is;

Is server 1 and server 2 behind the same firewall or are they exposed to the
internet?

Behind a firewall you can probably get away with running any one of the
following commands to remotely execute your script on server 2, from server
1;

Rexec, rsh, rpc, just to name 3.  The client part of the protocol is
required on server 1 and the daemon part needs to be running on server 2.

Across the open internet, be very careful here, I would think the choice
would be ssh (secure shell).  This has several nice features that could be
useful internally as well.  You start out by exchanging encryption keys
between the two servers and because of this handshake, each server trusts
the other in a way that the correct execution permissions can be established
on server 2, and of course the data sent between the servers is encrypted
rendering it virtually useless to third parties.  Google for ssh for more
info.

Warren Vail


-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to