Re: setting file permissions on a web server



I always read about how you need to set certain file permissions (for
cgi files, for example), but it's never been clear to me *how* you do
this. I know you can run the line

chmod 755 scriptname.py

but *where* do you run this? Is this done on your personal system, or on
the server? What if you are using Windows? If it's done on the server,
how do you do it?

The only way I've figured out so far how to do this is to upload my cgi
files to my server, then within my FTP program I right-click the file
and change its permission number that way, but that seems an inefficient
way to do it, especially having to do it each time.

Is there a way to put the above line within the script perhaps, so that
the script sets its permission automatically? Or do certain editors
allow you to save files with a predetermined permission?

Aside from my right-clicking method, I don't know how else to do it.

I guess this would be a good starting point:

http://www.linuxcommand.org/man_pages/chmod1.html

In short, chmod refers to local files so wherever you run it it will
refer to files on that machine. You run it simply by typing it in a
shell as a user who has privilage to perform the operatation, which
can mean you have to be an owner of the file but if you are root you
can do it in any case. Depending on your ftp, scp, http or whatever
method you use to transfer files the file permissions may or may not
change during the transfer. If permissions are kept intact you can
chmod on your local machine and then transfer, if they are not then
you transfer first and chmod on the server. When you transfer files
from a windows machine to *nix it again depends on the particular
method you choose how the permissions will be set.

There is no way of putting this permission information into the file
itself but some (most?) editors can be set to save the file with a
permission of your choice.

Hope this helps.
.



Relevant Pages

  • Re: [SLE] Nobody is home in Samba [Solved]
    ... The owner, group and world permissions are each defined by ... So chmod 0660 filename sets the file permission of filename to ... Similarly chmod 0750 filename sets the file permission of filename to ...
    (SuSE)
  • SUMMARY: chmod problem
    ... May Thanks to Scott, Andrew, John and Chamkura. ... Benjamins as his solution worked great without any copy, ftp or CD. ... I had a problem with chmod on Solaris 2.6. ... permission with chmod it says permission denied. ...
    (SunManagers)
  • Re: cant get passphrase auth with RH9 to RH 7.3
    ... Sorry for the noise level - I found that setting ... the server ~/.ssh/authority to permission 600 fixed ... chmod 600 ~/.ssh/authority_keys2 ...
    (comp.security.ssh)
  • Re: Oracle user group
    ... everyone but was changed to private in version 9.2.0.7 due to some ... wanting to keep all non-dba users from accessing the server side of ... chmod) and changing the permission on the oracle executable ... Linux Error: 13: Permission denied ...
    (comp.databases.oracle.server)
  • setting file permissions on a web server
    ... Is this done on your personal system, or on the server? ... The only way I've figured out so far how to do this is to upload my cgi files to my server, then within my FTP program I right-click the file and change its permission number that way, but that seems an inefficient way to do it, especially having to do it each time. ... Is there a way to put the above line within the script perhaps, so that the script sets its permission automatically? ...
    (comp.lang.python)