Re: using ssh via popen
| From: | Jeff P | Date: | Sun, 14 Jan 2001 23:46:31 +0000 |
| Subject: | Re: using ssh via popen | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-34517@lists.php.net to get a copy of this message | ||
probably because ssh requires an interactive
login; i.e. it expects STDIN as well. try adding
a command after the login parameter such as "ls"
and see what you get.
-jeff
> Can anyone shed any light on why the following code doesn't work? I'm
> trying to interact with ssh through PHP's popen function.
>
> Julia
>
> <?php
>
> function maxpsi($d) {
> $fp = popen("/usr/bin/ssh -l julie summit.magenet.com", "w");
> while ($string = fgets($fp,80)) {
> echo $string;
> }
> pclose($fp);
> }
>
> echo "running ssh<BR>";
>
> maxpsi(0);
>
> ?>
>
>