LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-29-2009, 06:30 AM   #1
dils
LQ Newbie
 
Registered: Mar 2009
Posts: 11

Rep: Reputation: 0
php problem - chown problem...


hello all,
am using fedora core 9 and i cannot login as root using the GUI
am developing an interface to act as a router and also a firewall...my problem is that i cannot run IPtables in my php script.... i have searched a bit on the internet and saw the setuid bit... and also something called chown.... how do i make system commands run in my php script? am quite new to linux and i cannot find a solution to this problem... :S
please help...
 
Old 05-29-2009, 08:43 AM   #2
PMP
Member
 
Registered: Apr 2009
Location: ~
Distribution: RHEL, Fedora
Posts: 381

Rep: Reputation: 58
Try Usind php function
exec_shell("command")
 
Old 05-30-2009, 02:34 AM   #3
dils
LQ Newbie
 
Registered: Mar 2009
Posts: 11

Original Poster
Rep: Reputation: 0
well the problem is not in my code.... i used the shell_exec commands in php... but it does not execute the system commands in shell... for example if i write shell_exec('service network restart')... the output gives me shutting down failed... is there some permissions problem or owner of file problem??
 
Old 05-31-2009, 07:07 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,348

Rep: Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749
You could use the setuid, but I'd go with using sudo instead.
PS Please add your distro/version to your profile to help us & you.
 
Old 06-01-2009, 04:10 PM   #5
soleilarw
Member
 
Registered: Apr 2009
Posts: 107

Rep: Reputation: 19
Fedora has removed root GUI logins as a default, but you are still able to launch X Windows from a root login.

Linux Archive

Last edited by soleilarw; 06-18-2009 at 04:21 AM.
 
Old 06-02-2009, 09:22 AM   #6
dils
LQ Newbie
 
Registered: Mar 2009
Posts: 11

Original Poster
Rep: Reputation: 0
hello there... well thank you very much for the suggestions... but i figured out the problem ... i set the userID bit and it worked. think that apache can execute the commends now
thnksss
Cheerssss
dils
 
Old 06-02-2009, 06:32 PM   #7
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,348

Rep: Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749
The problem with that is that now, any user/process can run it.... that's why I recommended sudo instead.
 
Old 07-28-2009, 05:17 AM   #8
dils
LQ Newbie
 
Registered: Mar 2009
Posts: 11

Original Poster
Rep: Reputation: 0
hello all....
i wish to thank you a lot for all ur help... it finally paid off and my application wrks... this application was for a final year project and i scored an A in that project.... thxxx a lottt
take care,
dils
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
chown problem selvkaumarmvs Linux - Newbie 6 04-20-2009 12:15 AM
chown problem jovie Linux - Newbie 8 04-10-2008 11:09 AM
[SOLVED] chown problem Wim Sturkenboom Linux - General 7 02-06-2007 02:18 AM
Problem with chown fgagnon Linux - General 9 04-03-2005 09:35 PM
chown problem Ayesha Linux - Newbie 4 04-17-2002 09:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration