473,383 Members | 1,822 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

permissions problem

i am writing a simple script that needs to read data from a file, say
foo.txt. When the script is called the server is run as 'nobody'. So I
chmod foo.txt to 606 so that nobody can read and write to it. The
problem with 606 is that now anyone can simply type in the url to
foot.txt, i.e http://mysite.com/foo.txt and read its contents. How can
I prevent this? I suppose I could raname it to foo.php instead?

Sep 26 '06 #1
6 1003
ve*****@yahoo.com wrote:
i am writing a simple script that needs to read data from a file, say
foo.txt. When the script is called the server is run as 'nobody'. So I
chmod foo.txt to 606 so that nobody can read and write to it. The
problem with 606 is that now anyone can simply type in the url to
foot.txt, i.e http://mysite.com/foo.txt and read its contents. How can
I prevent this? I suppose I could raname it to foo.php instead?
Don't have the file within your web site root directory. Or use Apache
configuration/.htaccess to block access to the file though the web. Or
change the script that reads it to run as another user.

All kinds of possibilities.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Sep 26 '06 #2

Jerry Stuckle wrote:
Don't have the file within your web site root directory. Or use Apache
configuration/.htaccess to block access to the file though the web. Or
change the script that reads it to run as another user.

All kinds of possibilities.
those probably would work but are a little more maintenance than i had
in mind. anything simpler we may be overlooking?

Sep 26 '06 #3
ve*****@yahoo.com wrote:
Jerry Stuckle wrote:

>>Don't have the file within your web site root directory. Or use Apache
configuration/.htaccess to block access to the file though the web. Or
change the script that reads it to run as another user.

All kinds of possibilities.


those probably would work but are a little more maintenance than i had
in mind. anything simpler we may be overlooking?
Not if it's in the docroot and you let everyone have read access to it.

Placing it outside the document root should have zero maintenance. If
it's always the same filename, setting up .htaccess has zero
maintenance. Making the script run as another user has zero maintenance.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Sep 26 '06 #4

Jerry Stuckle wrote:
>
Placing it outside the document root should have zero maintenance. If
it's always the same filename, setting up .htaccess has zero
maintenance. Making the script run as another user has zero maintenance.
These are all one extra thing you need to do to get the script to run.
I need to be able to setup the script on a different server often, so
this would add to the checklist. Hence I am looking for the easiest
solution that would not require me to make additional changes.

Sep 26 '06 #5
ve*****@yahoo.com wrote:
Jerry Stuckle wrote:
>>Placing it outside the document root should have zero maintenance. If
it's always the same filename, setting up .htaccess has zero
maintenance. Making the script run as another user has zero maintenance.


These are all one extra thing you need to do to get the script to run.
I need to be able to setup the script on a different server often, so
this would add to the checklist. Hence I am looking for the easiest
solution that would not require me to make additional changes.
So you're changing the conditions now. This isn't the same problem you
originally started with.

Well, you're going to have to do something anyway. Renaming it to .php
won't do a thing unless it's php code. And it has to go someplace.
Outside the server root directory is as good of a place as any.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Sep 26 '06 #6
In article <11**********************@h48g2000cwc.googlegroups .com>,
ve*****@yahoo.com wrote:
Jerry Stuckle wrote:

Placing it outside the document root should have zero maintenance. If
it's always the same filename, setting up .htaccess has zero
maintenance. Making the script run as another user has zero maintenance.

These are all one extra thing you need to do to get the script to run.
I need to be able to setup the script on a different server often, so
this would add to the checklist. Hence I am looking for the easiest
solution that would not require me to make additional changes.
Eh, he is giving you the solutions that apply to your problem. How
that affects your workflow wasn't known and isn't his problem. If the
file is in the docroot, people will be able to read it. Keep sensitive
data out of the docroot. run sensitive scripts as another user, use
..htaccess of you must have it in the docroot.
--
Sandman[.net]
Sep 26 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: lkrubner | last post by:
I want to give users the power to edit files from an easy interface, so I create a form and a PHP script called "fileUpdate". It does a reasonable about of error checking and prints out some...
0
by: Fran Tirimo | last post by:
I am developing a small website using ASP scripts to format data retrieved from an Access database. It will run on a Windows 2003 server supporting FrontPage extensions 2002 hosted by the company...
2
by: Fran Tirimo | last post by:
I am developing a small website using ASP scripts to format data retrieved from an Access database. It will run on a Windows 2003 server supporting FrontPage extensions 2002 hosted by the company...
2
by: K Finegan | last post by:
I have an archival process on a large database that runs once a month. At the beginning of the process the triggers and indexes on the tables whose data is moved are dropped, the data is moved and...
1
by: Chris | last post by:
I have seen the posts on various places on the internet about .NET framework mismatch issues and I don't think that is my problem. ; ) When I execute the following C++.NET code: String...
9
by: Ben Dewey | last post by:
Project: ---------------------------- I am creating a HTTPS File Transfer App using ASP.NET and C#. I am utilizing ActiveDirectory and windows security to manage the permissions. Why reinvent...
3
by: palepimp | last post by:
Hello all, I have searched far and wide for a solution to my issue. In short, here is the problem: 1. 3 PC's enter data into an Access 2003 database (PC's are running Vista w/ Office 2007...
3
by: Mike | last post by:
Hi I have problem as folow: Caught Exception: System.Configuration.ConfigurationErrorsException: An error occurred loading a configuration file: Request for the permission of type...
6
by: DotNetNewbie | last post by:
Hello, in my web application, I have to create permissions for each user. So what I am doing is that for each role (using sqlmembership in .net) I am creating a column in the database to hold a...
13
by: eclipsme | last post by:
I thought I had this licked, but apparently not. I have a file upload script that attempts to upload a file to a directory in the public_html directory - www.domain.com/upload The permissions...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.