User Tools

Site Tools


blog:set_rights_of_files_in_public_html

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
blog:set_rights_of_files_in_public_html [2011-03-11 07:43] brbblog:set_rights_of_files_in_public_html [2011-03-11 07:57] (current) brb
Line 1: Line 1:
 ====== Set rights of files in public_html ====== ====== Set rights of files in public_html ======
  
-<code> +Set rights of user /home/*/public_html directors in a secure and useful way 
-====== Set rights of files in public_html in a secure way ======+  - all files/directories get chown user:www-data, so users own them and the webserver has group access 
 +  - group www-data is added g+r for files (webserver can read all files) g+rsx for directories (webserver can read and change into all directories) 
 +  - o-rights (for all) are completely removed, so shell users can't read files of other users (possibly containing passwords etc).
  
-<file bash>+You can run the script using ''sudo fixphrights.sh'' or add a cron-job to go over all public_html directories every hour or so.  
 + 
 +Note: Users should be informed what happens, because a lot have taken the bad habit of doing chmod 755 to everything, and they will be confused if their files go back to 750 every hour. 
 + 
 +Ref: http://ubuntuincident.wordpress.com/2010/11/21/setting-rights-for-public_html/ 
 + 
 +<code bash>
 #!/bin/bash -  #!/bin/bash - 
 #=============================================================================== #===============================================================================
Line 28: Line 36:
 #          BUGS:  --- #          BUGS:  ---
 #         Notes:  --- #         Notes:  ---
-#        Author: Bernhard Brunner (bn), bernhard.brunner@epr.ch+#        Author: Bernhard Brunner (bn), bernhard point brunner att epr point ch
 #       Company: epr.ch #       Company: epr.ch
 #       Created: 2011/03/11 07:33 #       Created: 2011/03/11 07:33
Line 60: Line 68:
   fi   fi
 done done
-</file> +</code>
- +
-Ref: http://ubuntuincident.wordpress.com/2010/11/21/setting-rights-for-public_html/+
  
-{{tag>}}+{{tag>linux bash webserver}}
  
 ~~LINKBACK~~ ~~LINKBACK~~
 ~~DISCUSSION~~ ~~DISCUSSION~~
  
blog/set_rights_of_files_in_public_html.1299825781.txt.gz · Last modified: 2011-03-11 07:43 by brb