Don't know if this will help, but I worked on one implementation that
involved writing a daemon (we used perl, but php would work as well) which
runs as a user privileged script (started from cron), and waits for a
connection from my web app, and verifies that the request is coming from the
proper server and script, executes the ssh, and returns the controlled
result to the web app.  We also used this daemon to fork some processes and
create multi-threaded collection process (but that's another nut).

In my case the apache web server tasks ran as a user named "nobody", which
had no system privileges at all, a common safeguard, on RH Linux.

Warren Vail
[EMAIL PROTECTED]


-----Original Message-----
From: Robert Cummings [mailto:[EMAIL PROTECTED]
Sent: Monday, November 10, 2003 10:38 PM
To: tirumal b
Cc: PHP-General
Subject: Re: [PHP] ssh command in php script


On Tue, 2003-11-11 at 01:34, tirumal b wrote:
> Hello All
>
> I have written the following command in PHP script
> echo `ssh <ipaddr> <command>`. I have the remote ip
> addr as trusted, dont ask for the password at all.
> when the execute the php file from the browser it does
> not go to the remote ip at all though this command
> works fine in a normal bash script. what is the
> problem. Thanks in advance.

Shell commands run from the browser inherit the browser's user -- this
is usually httpd or apache.

Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

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

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

Reply via email to