LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-22-2004, 10:40 PM   #1
yazdan
LQ Newbie
 
Registered: Sep 2004
Posts: 8

Rep: Reputation: 0
linux permission


Dear all
help me please,
I want execute this command by php: "service network restart" or "reboot". owner and group of this php file is root. and I execute this command "chmod +s test.php" but I can't execute this command.
what can I do it ?
 
Old 09-23-2004, 12:38 AM   #2
dalek
Senior Member
 
Registered: Jul 2003
Location: Mississippi USA
Distribution: Gentoo
Posts: 2,058
Blog Entries: 2

Rep: Reputation: 79
It may not be in your command path. Type in the entire path. For me to restart my network for example, I have to type in

Code:
/etc/init.d/net.eth0 restart
If you cd to the directory /etc/init.d or whereever your command is, and put a ./ in frount of it as well. Like this:

Code:
cd /etc/init.d
./net.eth0 restart
They both work the same way and will do the same thing.

Hope that helps.

 
Old 09-23-2004, 10:28 AM   #3
yazdan
LQ Newbie
 
Registered: Sep 2004
Posts: 8

Original Poster
Rep: Reputation: 0
I execute it in this way, but didn't right.
I can't execute supper command such as "reboot" & "service ... restart " but I can do "ls" & "ifconfig" & "ping" and saw reply from this.
why?
 
Old 09-23-2004, 10:59 AM   #4
dalek
Senior Member
 
Registered: Jul 2003
Location: Mississippi USA
Distribution: Gentoo
Posts: 2,058
Blog Entries: 2

Rep: Reputation: 79
Are you logged in as root? This is not like windoze where when you are in, you are in. Each user has his/her own privledges. If you are not sure who you are logged in as, type in whoami. That will tell you who you are logged in as. If it is other than root, then it won't work if that command requires root access.

If it says you are not root, type in su, hit return, then type in your root password. Then try again.

Let me know what happens.

 
Old 09-23-2004, 03:58 PM   #5
yazdan
LQ Newbie
 
Registered: Sep 2004
Posts: 8

Original Poster
Rep: Reputation: 0
coution I want do this in php.
what is you Solution?
I want read & write 2 some file and then restart some service or restart computer. what is the best way?
 
Old 09-24-2004, 03:38 AM   #6
dalek
Senior Member
 
Registered: Jul 2003
Location: Mississippi USA
Distribution: Gentoo
Posts: 2,058
Blog Entries: 2

Rep: Reputation: 79
The best way is to make sure you are logged in as root and not as a user. What does whoami say?

 
Old 09-24-2004, 09:01 AM   #7
yazdan
LQ Newbie
 
Registered: Sep 2004
Posts: 8

Original Poster
Rep: Reputation: 0
I set on httpd.conf user=apache group=root
and then reply apache when I entered whoami.
 
Old 09-24-2004, 02:57 PM   #8
dalek
Senior Member
 
Registered: Jul 2003
Location: Mississippi USA
Distribution: Gentoo
Posts: 2,058
Blog Entries: 2

Rep: Reputation: 79
Me lost. I'm not sure what you are doing really.

Going by your name and such, I suspect english may not be your native language. You may want to check out the link in my sig. May get a better response there.

 
Old 09-24-2004, 09:38 PM   #9
yazdan
LQ Newbie
 
Registered: Sep 2004
Posts: 8

Original Poster
Rep: Reputation: 0
Dear dalek,
I want to create a php page for DHCP .
therefore I should :
read from /etc/dhcpd.conf and write to /etc/dhcpd.conf.
restart the service.
now I can do read & write. but I can't restart this service in this way "service dhcpd restart".

what is you Solution?
 
Old 09-24-2004, 11:04 PM   #10
Kahless
Member
 
Registered: Jul 2003
Location: Pennsylvainia
Distribution: Slackware / Debian / *Ubuntu / Opensuse / Solaris uname: Brian Cooney
Posts: 503

Rep: Reputation: 30
you might consider using a sudo command rather than making apache run as root, it would probally be a little more secure
 
Old 09-25-2004, 01:41 AM   #11
yazdan
LQ Newbie
 
Registered: Sep 2004
Posts: 8

Original Poster
Rep: Reputation: 0
Dear Kahless,
May you help me about format of sudo command.
How can I execute "service dhcpd restart" or "reboot" by sudo?

May I neet to reconfig /etc/passwd or /etc/sudoers files?
 
Old 09-26-2004, 11:27 PM   #12
yazdan
LQ Newbie
 
Registered: Sep 2004
Posts: 8

Original Poster
Rep: Reputation: 0
you should confirm that there is no body hear can help me.
 
Old 09-27-2004, 05:37 AM   #13
dalek
Senior Member
 
Registered: Jul 2003
Location: Mississippi USA
Distribution: Gentoo
Posts: 2,058
Blog Entries: 2

Rep: Reputation: 79
I think nobody here can figure out what you are doing. I haven't yet.



You know what you are trying to do. We do not until you tell us. If we don't know what you are trying to do, we can't help.

Help us to understand what you are doing, then we can help you do it.

Later

 
Old 09-27-2004, 05:40 AM   #14
yazdan
LQ Newbie
 
Registered: Sep 2004
Posts: 8

Original Poster
Rep: Reputation: 0
dear dalek,
have you yahoo id?
can we do chat with each other?
 
  


Reply



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
Writing permission for windows and linux partitions jaakkop Slackware 3 07-25-2005 06:14 AM
Linux permission help Sillysoft Linux - Security 3 02-24-2005 07:16 PM
Linux File permission & the sticky bit hq4ever Linux - Newbie 8 07-02-2004 03:46 PM
Win/Linux shared partition permission problems Ice Dragon Linux - Newbie 3 03-19-2004 05:52 PM
Permission for files created in NT for Linux use strik3r Linux - General 1 02-25-2004 04:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:30 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