Php ssh2 execution lifetime on the remote side

i am trying to run a bash script using php-ssh2, the script must run forever in the remote machine (the only way to stop it must be with pkill), the problem is that somehow the connection is closed and the bash script is killed.

Nohup, disown and screen… I tried everything and nothing really changed, it simply doesn’t KeepAlive that script.

What can I do?

(I know that this is a security hole (HUGE) but this is just experimental, the main idea is using an HTML button, run a bash script in the server computer, using apache2)


Source: bash

Leave a Reply