Mac Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsMac Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old March 7th, 2005, 01:38 AM
Oak72 Oak72 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 14 Oak72 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 17 m 38 sec
Reputation Power: 0
Arrow Securing my Web Development Folder

On my Mac (10.3.8) I created a folder in my Home User Dir. In this folder I keep the websites I work on.
Everything works great with Apache and MySQL.

Only thing is, I don't like other users on my Mac to have access to these files (like they have no access to folders such as: Documents and Library).
So I gave my directory which holds all websites the same rights as the other restricted dirs (Ownership & Permissions; Others : No Access). So far no problem. Other users can't access my files anymore.

But Also Apache can't access my webfiles anymore!!!

Bottomline: I like me, myself and Apache to have access to the files, and no other users.

I think it's possible to do this via group-access. But I can't find the httpd user to add to this group. What user is Apache running under?

Or does anybody has experience with this type of problem??
Thanks!
Cheers, Frank

Reply With Quote
  #2  
Old March 7th, 2005, 02:31 PM
KenPed's Avatar
KenPed KenPed is offline
Looking for something to do
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2004
Posts: 708 KenPed User rank is Corporal (100 - 500 Reputation Level)KenPed User rank is Corporal (100 - 500 Reputation Level)KenPed User rank is Corporal (100 - 500 Reputation Level)KenPed User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 4 h 4 sec
Reputation Power: 6
Maybe its better to only use the access in Apache ??

Have a look at this:
http://httpd.apache.org/docs/misc/FAQ.html#remote-auth-only
__________________
Kenped

Reply With Quote
  #3  
Old March 9th, 2005, 07:50 AM
netytan's Avatar
netytan netytan is offline
Hello World :)
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Mar 2003
Location: Hull, UK
Posts: 2,479 netytan User rank is Sergeant Major (2000 - 5000 Reputation Level)netytan User rank is Sergeant Major (2000 - 5000 Reputation Level)netytan User rank is Sergeant Major (2000 - 5000 Reputation Level)netytan User rank is Sergeant Major (2000 - 5000 Reputation Level)netytan User rank is Sergeant Major (2000 - 5000 Reputation Level)netytan User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 7 h 39 m 48 sec
Reputation Power: 46
Send a message via ICQ to netytan Send a message via AIM to netytan Send a message via MSN to netytan Send a message via Yahoo to netytan
Quote:
Originally Posted by Oak72
On my Mac (10.3.8) I created a folder in my Home User Dir. In this folder I keep the websites I work on.
Everything works great with Apache and MySQL.

Only thing is, I don't like other users on my Mac to have access to these files (like they have no access to folders such as: Documents and Library).
So I gave my directory which holds all websites the same rights as the other restricted dirs (Ownership & Permissions; Others : No Access). So far no problem. Other users can't access my files anymore.

But Also Apache can't access my webfiles anymore!!!

Bottomline: I like me, myself and Apache to have access to the files, and no other users.

I think it's possible to do this via group-access. But I can't find the httpd user to add to this group. What user is Apache running under?

Or does anybody has experience with this type of problem??
Thanks!
Cheers, Frank


What do the file permissions you're using now look like, if you've trurned of the the x-bit then Apache won't be able to access the folder. I would change the folders permissions to 711, if you haven't already and see if that works. .

I'll test this out a little later today,

Mark.
__________________
...
> (define links (list google scheme ruby python others ...)) ; Read my blog at http://netytan.blogspot.com/.
> _



Reply With Quote
  #4  
Old March 9th, 2005, 10:22 AM
netytan's Avatar
netytan netytan is offline
Hello World :)
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Mar 2003
Location: Hull, UK
Posts: 2,479 netytan User rank is Sergeant Major (2000 - 5000 Reputation Level)netytan User rank is Sergeant Major (2000 - 5000 Reputation Level)netytan User rank is Sergeant Major (2000 - 5000 Reputation Level)netytan User rank is Sergeant Major (2000 - 5000 Reputation Level)netytan User rank is Sergeant Major (2000 - 5000 Reputation Level)netytan User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 7 h 39 m 48 sec
Reputation Power: 46
Send a message via ICQ to netytan Send a message via AIM to netytan Send a message via MSN to netytan Send a message via Yahoo to netytan
Ok I can now confirm this, provided that the user trying to access the folder isn't in your group or doesn't have super user privileges chmoding to 711 or 701 will be enough to keep them out . And, provided that that last x-bit is turned on Apache still has access.

The power of Unixs file permissions .

Mark.

Reply With Quote
  #5  
Old March 12th, 2005, 05:24 AM
Oak72 Oak72 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 14 Oak72 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 17 m 38 sec
Reputation Power: 0
Thanks Mark!!!

this did the trick!
excellent! Even other Administrator don't have access to it anymore, at least as far as I checked it in the Finder.

Funny thing is, you can only do this with the Terminal, not via 'Get Info' on a folder in the Finder.

thanks a lot!!

Reply With Quote
  #6  
Old March 14th, 2005, 12:30 PM
netytan's Avatar
netytan netytan is offline
Hello World :)
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Mar 2003
Location: Hull, UK
Posts: 2,479 netytan User rank is Sergeant Major (2000 - 5000 Reputation Level)netytan User rank is Sergeant Major (2000 - 5000 Reputation Level)netytan User rank is Sergeant Major (2000 - 5000 Reputation Level)netytan User rank is Sergeant Major (2000 - 5000 Reputation Level)netytan User rank is Sergeant Major (2000 - 5000 Reputation Level)netytan User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 7 h 39 m 48 sec
Reputation Power: 46
Send a message via ICQ to netytan Send a message via AIM to netytan Send a message via MSN to netytan Send a message via Yahoo to netytan
I've noticed that but I can't really tell you why that is. Maybe Apple didn't want to trouble users with an the x-bit when all most users only care about read and write .

I guess that adding "execute" permissions might be a little confusing . Luckily for me I enjoy playing with Mac OS Xs Unix underpinnings but maybe this will be added in Tiger.

Anyway you should be able to write a simple Applescript to make this kind of thing easier. This of course lacks any GUI bits but the general idea is there.

Code:
tell application "Finder"
	set pathName to POSIX path of (selection as string)
	
	-- Run the chmod +x command on the selected
	-- pathName in the Finder. Making the file
	-- executable.
	tell application "Terminal" to ¬
		do shell script "chmod +x" & space & pathName
end tell


Note: this code is far from finished and is ment to ilustrate a point only.

take care,

Mark.

Reply With Quote
  #7  
Old March 20th, 2005, 04:13 PM
netytan's Avatar
netytan netytan is offline
Hello World :)
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Mar 2003
Location: Hull, UK
Posts: 2,479 netytan User rank is Sergeant Major (2000 - 5000 Reputation Level)netytan User rank is Sergeant Major (2000 - 5000 Reputation Level)netytan User rank is Sergeant Major (2000 - 5000 Reputation Level)netytan User rank is Sergeant Major (2000 - 5000 Reputation Level)netytan User rank is Sergeant Major (2000 - 5000 Reputation Level)netytan User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 7 h 39 m 48 sec
Reputation Power: 46
Send a message via ICQ to netytan Send a message via AIM to netytan Send a message via MSN to netytan Send a message via Yahoo to netytan
Ok so I got a little stalled and ended up playing around with the Applescript I posted above. Add about 10 more lines and we have something useful which can now turn the x bit on or off .

Code:
-- This simple AppleScript turns  the the x bit for selected files/folders on
-- or off depending on the users choice in the dialog created below.

set the usersChoice to the button returned of (display dialog ¬
	"Turn x bit for selection" buttons {"On", "Off"} default button 1)

if the usersChoice is "On" then
	-- Sets the chmod command to turn the x bit on if the "On" button
	-- was clicked.
	set chmod to "chmod +x"
else
	set chmod to "chmod -x"
end if

-- The section below does the actual work using the values set up
-- in the section above. Note: that this will apply your choice to all
-- of the selected files/folders.

tell application "Finder"
	repeat with pathName in (selection as list)
		-- Run the chmod +x command on the each of the selected
		-- files and or folders, turning on there x bit.
		do shell script chmod & space & POSIX path of ¬
			(pathName as string)
	end repeat
end tell
Comments on this post
SimonGreenhill agrees!

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsMac Help > Securing my Web Development Folder


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway