phptty
phptty copied to clipboard
Support of CMD /bin/sh | bash
Is it possible to support /bin/sh or bash ?
Great Job Workerman ;)
Maybe. I'm not sure.
I've try but that didn't work.
If it work, you made something incredible, at this time, the only way to do that is without PHP (take a look here http://developers-club.com/posts/139878/ )
You can get this working by changing, pipe
to tty
, it mentions that in the code.
$descriptorspec = array(
0=>array("pty", "r"),
1=>array("pty", "w"),
2=>array("pty", "w")
);
and then define('CMD', 'bash');
If you start the script as root it will switch to www-data
user just fine, but a normal user won't be able to set the user so it will be run as the user which started it, your get Warning: change gid or uid fail.
Interesting script thanks.