User not logged in - login - register
Home Calendar Books School Tool Photo Gallery Message Boards Users Statistics Advertise Site Info
go to bottom | |
 Message Boards » » PHP exec() command Page [1]  
monvural
All American
558 Posts
user info
edit post

I want to ssh into another box and check to see if a process is running on that box. I've set up the keys in ssh to work properly and if I run it off the command line my commands work. When I run it through the php exec() command, they don't. Here's what I'm trying to do:

exec("ssh db2read@as20alyn; ps -ef | grep 'db2_extract.ksh'");

any suggestions?

TIA

8/5/2005 1:35:48 PM

SandSanta
All American
22435 Posts
user info
edit post

have you tried shell_exec?

8/5/2005 3:34:58 PM

Noen
All American
31346 Posts
user info
edit post

are you running this on your local machine?

because if not, this isnt ever going to work. PHP is setup to run exec command either under the apache user or under the nobody user. Either way, unless you get creative with user and group permissions, it's either never going to work, or its going to be an ungodly bad bad bad security problem.

8/8/2005 6:24:22 AM

Wolfmarsh
What?
5975 Posts
user info
edit post

It will work fine, just use sudo in conjunction with your exec.

8/8/2005 7:31:08 AM

 Message Boards » Tech Talk » PHP exec() command Page [1]  
go to top | |
Admin Options : move topic | lock topic

© 2024 by The Wolf Web - All Rights Reserved.
The material located at this site is not endorsed, sponsored or provided by or on behalf of North Carolina State University.
Powered by CrazyWeb v2.39 - our disclaimer.