Just wondering, is there anyway to reuse a ssh connection in abother php script page. like, I open a connection on page A, and I finished ahtorization, but I want to process user command in another script page B, is ther any way to run the command avoid to estanblish another connection?
4 Answers
@code_burgar: what about mysql_pconnect()?
To the OP: what about replacing all instances of fsockopen() with pfsockopen() in phpseclib, a pure PHP SSH implementation
Comments
Yes, it can be done if you use OpenSSH to connect to the remote server and use the connection multiplexing feature.
Read the ssh manual pages for the details, specially the ControlMaster entry in ssh_config(5).