LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-29-2009, 11:14 AM   #1
demia
LQ Newbie
 
Registered: Apr 2009
Posts: 28

Rep: Reputation: 15
How can I grant Apache User Umount rights?


Hi,

I want my apache user (www-data) to be able to umount drives that are mounted with fuse. (i think it is the same as regular umount, but i'm not sure)

when i execute: www-data@1:$ umount /2345
umount: /2345 is not in the fstab (and you are not root)

how can i get this done?
 
Old 04-30-2009, 06:23 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
You could use a Sudo NOPASSWD line. Instead I'd route the command through a CGI or implement checks otherwise, else you might make the code capable of umounting more than you will find funny.
 
Old 04-30-2009, 08:23 AM   #3
demia
LQ Newbie
 
Registered: Apr 2009
Posts: 28

Original Poster
Rep: Reputation: 15
Thanks unSpawn, can you explain a little more "route the command through a CGI or implement checks otherwise" ?


My take on the matter is this:

My main website has the root /home/main

all the other websites has the root /othersites/

and i restrict all other websites with virtual host command below.

<Directory /othersites>
php_admin_flag safe_mode On
AllowOverride None
</Directory>

So only main website can execute commands, no other. But please do tell me if i'm missing something because we will be online soon.


Cheers,
 
Old 04-30-2009, 08:58 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by demia View Post
can you explain a little more "route the command through a CGI or implement checks otherwise" ? (..) only main website can execute commands, no other.
Think about it this way: what is it exactly that keeps me, as unauthorized user from executing the command in the webserver and the application? What is it exactly that keeps me, as authorized user, from executing the command in the webserver and the application on any mounted partition?

In terms of restrictions and checks this should be a combination of only allowing certain IP addresses or maintenance ranges access to this part of the webserver, a separate account with a strong passhprase for only certain admin tasks, using HTTPS, narrowing the amount of mountpoints to be selected as umountable. Logging access to this part of the webserver and commands run would be beneficial for recordkeeping.
 
Old 04-30-2009, 09:05 AM   #5
demia
LQ Newbie
 
Registered: Apr 2009
Posts: 28

Original Poster
Rep: Reputation: 15
I think, if i put phpSafeMode = on to all the folders that you have access as unauthorized user, you can run absolutely no command therefore, even i give reboot rights to apache user, it will not be able to do anything harmful.

Only my main website code which is running outside of that directory can execute those commands even though it is the same unix user.


This setup is the one that i find easiest, and hopefully i'm not missing anything.
 
  


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
MySQL: Grant user database creation rights Swakoo Linux - General 4 09-13-2006 06:34 AM
how to grant permissions to a user yeehi Linux - General 3 10-20-2004 07:42 AM
grant user access to /fat-c & copying users' preferences to another user n0x Linux - Newbie 1 07-04-2004 12:04 AM
grant a user access to /fat-c n0x Slackware 4 05-02-2004 12:10 PM
grant a user FTP rights only plisken Linux - Software 0 01-31-2004 05:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:49 PM.

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