views:

409

answers:

5

Is it posible,
to modify or edit txt file,
if the file's permission is set as 606 ,
via WEB browser , by normal users ?


I mean I make a txt file named "1.txt"

The first original contents of the txt file is "PAX is great man"

and then ,I upload this file to server.

I set the permission of the file as 606.

so the general users can now modify the file.

so anyone become to be able to edit that file into "PAX eat camel meat" ?

or can not?

A: 

This entirely depends on your webserver, certainly anyone on the local system (who isn't in the group) can write to the file.

Please assume that the web server is Apatch.Or are you mentioning other meanings?
Jonathan itou
A: 

'606' means read AND write permissions for the user creating the file and for others. So in effect in enables anyone to edit the file if they are on the same system. Whether they can do it via the Web browser depends on the webserver and its configuration.

Rutger Nijlunsing
but how do they do it? I can understand for the read one.I can just specify the URL, like www.blahblah.com/1.txt, then I can see the file contents. but how do you do when you want to edit the file?
Jonathan itou
Ok, then make a file's permission as 606 is a dangerous thing, right?
Jonathan itou
If the webserver is only serving the content, then a webbrowser contacting the webserving can only be served the content, not modify it. However, if you have a webpage on the webserver which does some uploading, you might find your file changed.
Rutger Nijlunsing
ok, make a file as 606 + file uploading = danger?
Jonathan itou
+2  A: 

If your webserver does not support the PUT or DELETE command (and most webservers don't by default) and you don't provide a script where any user can edit your files from the outside, I see no way a remote user could edit your file. W3.org. Just a short additional note: If only the webserver and a browser are involved in this case, you could even change the rights of this file to 777 and no one should be able to edit your file.

merkuro
You mean that in most cases its safe if I make 1.txt as 606?but if I pt file upload thing ,then it become danger?
Jonathan itou
Yes. A normal text file, regardless of the permissions, will not get edited or deleted remotely via the http protocol on a default webserver configuration. However, if you provide additional server site features via scripts/programs, like uploading or editing files this is complete different story and depends on the script in question.
merkuro
thank you , I got. I want to give you site money.
Jonathan itou
You are welcome. Don't bother thinking about money. Just hang around for a couple of hours maybe days and try to help others.
merkuro
I am making my own money system, that pass only my own site.Its similer to online game money.please click my name then click "web site" then you can see my site.
Jonathan itou
A: 

Why don't you just set the permissions on it to 604? That way, the file can only be edited by you, even locally!

Fat Lotus
A: 

Jonathan,

Can you please provide more details of your question? By "modifying the file", this could mean too many possibilities. To talk about security and permissions, you have to determine in what way your files are accessed first. By the way you asked your question, I am going to make these assumptions:

(A) You do not own your server. You cannot make system-wide configuration changes to your server.

(B) Other people can login to use this server. (This means having access to a command prompt of this server.) You do not trust these people and do not want them to modify your files.

(C) Your web server is either Apache or Microsoft IIS.

.

By "modifying the file", there are some possibilities:

(1) When you visit the URL, it shows the original content of the file and a "Modify" button. If you click the "Modify" button, the original content will be shown in a text area and a "Save" button comes out. After you finish editing, you click "Save" to save the changes.

(2) There is NO editing interface. The interface is like a "file manager". You just upload another file with the same name to overwrite / replace the original file.

.

If what you want is (1) above, you have to write a server-side script (eg. PHP, ASP, etc.) (Of course you can use server-side scripts written by other people too!). Make sure your server does support the language (+ dependent libraries) you choose.

If what you want is (2) above, there are many ways to achieve, but I'm afraid a server configuration change must be done:

(1) You can add an FTP server to your server (if you can). Then using Firefox with the FireFTP plugin (or using Internet Explorer, if that is your choice), you can upload / download the file.

(2) You can add / enable the WebDAV module to your web server. Adding "WebDAV" function allows files to be opened / uploaded via HTTP. Microsoft call this "web folder". Linux and Apple call this "WebDAV" (the original name). There shouldn't be a problem to upload your files with Windows Explorer (Windows) / nautilus (Linux - Gnome) / Finder (Max OS X), even they are not browsers.

.

Please provide more information to your question.

Kenji

Siu Ching Pong - Asuka Kenji