Difference between revisions of "How do Windows file permissions work?"

From Joomla! Documentation

(A few more corrections. Removed the Needs Review tag.)
 
(9 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{page|needs review|A better title is probably in order too. Something like '''Windows Server Permissions for Joomla! Installations''' or something similar and less wordy.}}
+
<noinclude><languages /></noinclude>
== Joomla and Windows file permissions - Explanation ==
+
<translate>== Joomla and Windows File Permissions - Explanation == <!--T:1--></translate>
<p>For those of you that are either developing or delivering your Joomla&#33; Web-Sites from a Windows environment, it is sometimes difficult to obtain relevant information regarding permissions. Unfortunately, it is a fact that most Web-Serving is offered under Unix and that Unix is pretty well documented within this environment. Hopefully, the following information will go some way to clear up any confusion and provide a little guidance as well.
+
<translate><!--T:2--> <p>For those of you that are either developing or delivering your Joomla&#33; websites from a Windows environment, it is sometimes difficult to obtain relevant information regarding permissions. Unfortunately, it is a fact that most Web-Serving is offered under Unix and that Unix is pretty well documented within this environment. Hopefully, the following information will go some way to clear up any confusion and provide a little guidance as well.</translate>
  
===== Windows Web-Servers Overview =====
+
<translate>=== Windows Web Server Overview === <!--T:3--></translate>
Firstly, lets discuss the differences between servers. In general, most Windows folks appear to be using either Apache(Win32) or Microsoft IIS, these two web servers operate very differently and utilize slightly different models of delivery.
+
<translate><!--T:4-->
Apache(Win32) generally runs on the host computer as the User that it was installed under, whereas IIS installs under a specific user but will run under a newly installed user " IUSR_ ".
+
First, let's discuss the differences between servers. In general, most Windows folks appear to be using either Apache (Win32) or Microsoft IIS. These two web servers operate very differently and utilize slightly different models of delivery.
 +
Apache (Win32) generally runs on the host computer as the User that it was installed under, whereas IIS installs under a specific user but will run under a newly installed user ''IUSR_''.</translate>
  
===== Permission Defaults =====
+
<translate>=== Permission Defaults === <!--T:5--></translate>
By default, Unix tends to only give full access to the "owning" user to files and directories, in opposition to this approach Windows by default will also assign the Group "Everyone", Full permissions. The first thing any good Windows Administrator will do is to remove the rights of the "Everyone" group, to improve security. For local PC testing, this is probably not necessary, but explains why, if "Everyone" is not removed and you run some form of permissions check script or the Joomla! Pre-Installation check, on the whole you will have Full "Read, Write and Execute" permissions, because you are acquiring the rights of the "Everyone" Group.
+
<translate><!--T:6--> By default, Unix tends to only give full access to the ''owning'' user to files and directories. In contrast, Windows by default will also assign the group ''Everyone'' full permissions. The first thing any good Windows Administrator will do is remove the rights of the ''Everyone'' group to improve security. For local PC testing, this is probably not necessary, but explains why, if ''Everyone'' is not removed and you run some form of permissions check script or the Joomla! Pre-Installation check, you will have full ''Read, Write and Execute'' permissions. You are acquiring the rights of the ''Everyone'' group.</translate>
  
===== Microsoft Internet Information Server (IIS) =====
+
<translate>=== Microsoft Internet Information Server (IIS) === <!--T:7--></translate>
IIS comes in two main flavors, PWS (Personal WebServer), and IIS (Internet Information Server). Essentially these are the same application. PWS is just a cut-down version of IIS designed for desktop environments, whereas IIS is designed for Server environments. PWS limits you to a single main website, so your application installations will generally be in sub-directories of the main website. IIS, on the other hand, provides the functionality for Virtual Hosts to be run from these directories, delivering multi-site capability.
+
<translate><!--T:8--> IIS comes in two main flavors, PWS (Personal WebServer), and IIS (Internet Information Server). Essentially these are the same application. PWS is just a cut-down version of IIS designed for desktop environments, whereas IIS is designed for Server environments. PWS limits you to a single main website, so your application installations will generally be in sub-directories of the main website. IIS, on the other hand, provides the functionality for Virtual Hosts to be run from these directories, delivering multi-site capability.</translate>
  
Due to the different functionality limitations, PWS does not have the "Permissions Wizard" as it is determined to not be needed. Only one user will be using the PWS Server. In IIS, many users will be using the Server, thus differing permission assignments are needed.
+
<translate><!--T:9--> Due to the different functionality limitations, PWS does not have the ''Permissions Wizard'' as it is determined to not be needed. Only one user will be using the PWS Server. In IIS, many users will be using the Server, thus differing permission assignments are needed.</translate>
  
Once the "Everyone" account is removed, Windows IIS is now left with the " IUSR_* " account having top-level rights to the Web-Server directories. A permissions check now should yield different results. Only the IUSR_* account has full permissions and other users should acquire either "Read Only" or no rights. Rights are determined by which other users have been assigned which rights to the IIS directories manually.
+
<translate><!--T:10--> Once the ''Everyone'' account is removed, Windows IIS is now left with the ''IUSR_*'' account having top-level rights to the Web-Server directories. A permissions check now should yield different results. Only the ''IUSR_*'' account has full permissions and other users should acquire either ''Read Only'' or no rights. Rights are determined by which other users have been assigned which rights to the IIS directories manually.</translate>
  
===== Assigning Permissions =====
+
<translate>=== Assigning Permissions === <!--T:11--></translate>
 +
<translate><!--T:12-->
 
Assigning permissions in Windows is reasonably straight forward, but can be a little confusing at times.
 
Assigning permissions in Windows is reasonably straight forward, but can be a little confusing at times.
Right-Click on the appropriate folder or file. Selecting "Properties" or "Sharing and Security" will enter the Windows Security Management pane. Selecting (click once) any user name listed will display the rights that user has in the bottom half of the pane. Some rights might be "greyed" out. These are unavailable, either because the current user (you are logged in as) does not have high enough permissions to alter them, or they are inherited from the directory above and have been set to use that higher level directory's permissions (this is generally the default mechanism).
+
Right-Click on the appropriate folder or file. Selecting ''Properties'' or ''Sharing and Security'' will enter the Windows Security Management pane. Selecting (click once) any user name listed will display the rights that user has in the bottom half of the pane. Some rights might be ''greyed'' out. These are unavailable, either because the current user (you are logged in as) does not have high enough permissions to alter them, or they are inherited from the directory above and have been set to use that higher level directory's permissions. (This is generally the default mechanism.)</translate>
  
As you can see, Windows utilizes the following Permissions/Rights scheme:
+
<translate><!--T:13--> As you can see, Windows utilizes the following Permissions/Rights scheme:</translate>
  
 +
{| style="border: solid thin; margin-left: auto; margin-right: auto;"
 +
| style="text-align:center; border: solid thin; width: 5%" | 1
 +
| style="border: solid thin; width: 20%;" | <translate><!--T:14--> Full Control</translate>
 +
| style="border: solid thin; width: 30%;" | <translate><!--T:15--> Allows:</translate> 1, 2, 3, 4, 5, 6, 7
 +
|-
 +
| style="text-align:center; border: solid thin; width: 5%" | 2
 +
| style="border: solid thin; width: 20%;" | <translate><!--T:16--> Modify</translate>
 +
| style="border: solid thin; width: 30%;" | <translate><!--T:17--> Allows:</translate> 2, 3, 4, 5, 6
 +
|-
 +
| style="text-align:center; border: solid thin; width: 5%" | 3
 +
| style="border: solid thin; width: 20%;" | <translate><!--T:18--> Read &amp; Execute</translate>
 +
| style="border: solid thin; width: 30%;" | <translate><!--T:19--> Allows:</translate> 3, 4
 +
|-
 +
| style="text-align:center; border: solid thin; width: 5%" | 4
 +
| style="border: solid thin; width: 20%;" | <translate><!--T:20--> List Folder Contents</translate>
 +
| style="border: solid thin; width: 30%;" | <translate><!--T:21--> Allows: 4 (but cannot run programs)</translate>
 +
|-
 +
| style="text-align:center; border: solid thin; width: 5%" | 5
 +
| style="border: solid thin; width: 20%;" | <translate><!--T:22--> Read</translate>
 +
| style="border: solid thin; width: 30%;" | <translate><!--T:23--> Allows: 5 (Implies: 4)</translate>
 +
|-
 +
| style="text-align:center; border: solid thin; width: 5%" | 6
 +
| style="border: solid thin; width: 20%;" | <translate><!--T:24--> Write</translate>
 +
| style="border: solid thin; width: 30%;" | <translate><!--T:25--> Allows: 6 (Implies: 4 )</translate>
 +
|-
 +
| style="text-align:center; border: solid thin; width: 5%" | 7
 +
| style="border: solid thin; width: 20%;" | <translate><!--T:26--> Special Permissions</translate>
 +
| style="border: solid thin; width: 30%;" | <translate><!--T:27--> Allows: Combinations</translate>
 +
|}
 +
 +
<translate>=== Windows File Permissions Properties === <!--T:28--></translate>
 +
<translate><!--T:29--> Windows file permissions can be seen as having '''similar''' properties as UNIX or Linux file (Modes) permissions. They are just represented differently. For example, if you are primarily a Unix/Linux user, you are probably used to having permissions represented as 644/666 755/777, instead of being described in the terms above. So, when you use ''644'', this means:
 +
* The owner of this file can read and write to it.
 +
* The owner's group can read the file.
 +
* Everyone else can read the file.</translate>
 +
 +
<translate><!--T:32--> '''Note''' Windows and Unix permissions (Access Control Lists) do not equate exactly; Windows does not use the ''Groups'' mechanism in the same manner. For this discussion and in regards to the web hosting environment, they can be equated.</translate>
 +
<translate><!--T:33--> Ah, but in Windows ''Groups'' are not used and ''Everyone'' should have been removed.</translate>
 +
<translate><!--T:34--> This is where Windows and Unix do not quite equate, but what can be done is to ''match'' or ''correlate'' equivalent meanings.
 +
 +
This outline is not really going to provide you with a Windows- or an NTFS-specific permissions guide but more of an understanding of how the commonly quoted numbered UNIX/Linux style permissions correlate on a machine with an NTFS file system.</translate>
 +
<translate><!--T:35--> The files that are placed in the ''www'' or ''public_html'' root folder, or whatever directory your site (''www.domain.com'' or localhost) points to on your hard drive should be owned by your user account, but only if that user is not what is considered as a privileged user such as ''Administrator'' on Windows or ''root'' on UNIX/Linux. These accounts allow way too much access and should never be used for everyday use.</translate>
 +
 +
<translate>=== Best Practices === <!--T:36--></translate>
 +
<translate><!--T:37--> Commonly used security practices suggest that all '''files''' should have the following permissions:
 +
* '''Owner''' Read &amp; Write
 +
* '''Group''' Read Only
 +
* '''Others''' Read Only</translate>
 +
<translate><!--T:40-->
 +
All '''directories/folders''' should have the following permissions:</translate>
 +
<translate><!--T:41--> * '''Owner''' Read, Write &amp; Execute</translate>
 +
<translate><!--T:42--> * '''Group''' Read &amp; Execute</translate>
 +
<translate><!--T:43--> * '''Others''' Read &amp; Execute</translate>
 +
<translate><!--T:44--> Arguably, this is not necessarily ''optimum'' security, but a balance must be struck between security, functionality and maintainability.</translate>
 +
<translate><!--T:45--> Windows, unlike Unix, does not maintain a single ACL for ''Execute'', but simply provides ''Read &amp; Execute'' combined, which does not imply ''Write''. The ''Read &amp; Execute'' ACL does however implies ''List Directory Contents''. Therefore, if you have only ''Read &amp; Write'' permissions on a directory but no ''Execute'' you will not be able to see the contents of the directory and may also have problems when attempting to run the file through a web browser.</translate>
 +
<translate><!--T:46-->
 +
A little understanding of UNIX/Linux permissions is required to fully equate/correlate them to Windows permissions. The following table should assist:</translate>
  
{| style="border-collapse: collapse" cellpadding="2" cellspacing="0" align="center" border="1" bordercolor="#000000" height="147" width="533"
+
{| style="border: solid thin; margin-left: auto; margin-right: auto;"
|  align="left" width="5%" valign="top" | <p>1.&nbsp;</p>
+
| style="text-align:center; border: solid thin; background-color: #ddd; width:5%" | '''<translate><!--T:68--> Unix Mode</translate>'''
| align="left" width="33%" valign="top" | <p>Full Control</p>
+
| style="border: solid thin; background-color: #ddd; width: 8%;" | '''<translate><!--T:69--> Windows ACL</translate>'''
| align="left" width="33%" valign="top" | <p>Allows: 1, 2, 3, 4, 5, 6, 7</p>
+
| style="border: solid thin; background-color: #ddd; width: 30%;" | '''<translate><!--T:47--> Comments</translate>'''
|-  
+
|-
| align="left" width="5%" valign="top" | <p>&nbsp;2.</p>
+
| style="text-align:center; border: solid thin; width: 5%" | '''7'''
| align="left" width="33%" valign="top" | <p>&nbsp;Modify</p>
+
| style="border: solid thin; width: 8%;" | '''<translate><!--T:48--> Modify</translate>'''
| align="left" width="33%" valign="top" | <p>Allows: 2, 3, 4, 5, 6</p>
+
| style="border: solid thin; width: 30%;" | <translate><!--T:49--> Read, Write &amp; Execute, you should be the owner of this file</translate>
|-  
+
|-
| align="left" width="5%" valign="top" | <p>&nbsp;3.</p>
+
| style="text-align:center; border: solid thin; width: 5%" | '''6'''
| align="left" width="33%" valign="top" | <p>&nbsp;Read &amp; Execute</p>
+
| style="border: solid thin; width: 8%;" | <translate><!--T:50--> '''Read &amp; Write'''</translate>
| align="left" width="33%" valign="top" | <p>Allows: 3, 4&nbsp;</p>
+
| style="border: solid thin; width: 30%;" |
|-  
+
|-
| align="left" width="5%" valign="top" | <p>&nbsp;4.</p>
+
| style="text-align:center; border: solid thin; width: 5%" | '''5'''
| align="left" width="33%" valign="top" | <p>&nbsp;List Folder Contents</p>
+
| style="border: solid thin; width: 8%;" | <translate><!--T:51--> '''Read &amp; Execute'''</translate>
| align="left" width="33%" valign="top" | <p>Allows: 4 (but cannot run programs)&nbsp;</p>
+
| style="border: solid thin; width: 30%;" | <translate><!--T:52--> Used for most applications</translate>
|-  
+
|-
| align="left" width="5%" valign="top" | <p>&nbsp;5.</p>
+
| style="text-align:center; border: solid thin; width: 5%" | '''4'''
| align="left" width="33%" valign="top" | <p>&nbsp;Read</p>
+
| style="border: solid thin; width: 8%;" | <translate><!--T:53--> '''Read Only'''</translate>
| align="left" width="33%" valign="top" | <p>Allows: 5 (Implies: 4)<br></p>
+
| style="border: solid thin; width: 30%;" | <translate><!--T:54--> Security through obscurity is not a good practice</translate>
|-  
+
|-
| align="left" width="5%" valign="top" | <p>&nbsp;6.</p>
+
| style="text-align:center; border: solid thin; width: 5%" | '''3'''
| align="left" width="33%" valign="top" | <p>&nbsp;Write</p>
+
| style="border: solid thin; width: 8%;" | <translate><!--T:55--> '''Write &amp; Execute'''</translate>
| align="left" width="33%" valign="top" | <p>Allows: 6 (Implies:4 )<br></p>
+
| style="border: solid thin; width: 30%;" | <translate><!--T:56--> Not available through Windows, unless ''Special'' Permissions is used; not commonly used</translate>
|-  
+
|-
| align="left" width="5%" valign="top" | <p>7.</p>
+
| style="text-align:center; border: solid thin; width: 5%" | '''2'''
| align="left" width="33%" valign="top" | <p>&nbsp;Special Permissions</p>
+
| style="border: solid thin; width: 8%;" | <translate><!--T:57--> '''Write Only'''</translate>
| align="left" width="33%" valign="top" | <p>Allows: Combinations&nbsp;</p>
+
| style="border: solid thin; width: 30%;" | <translate><!--T:58--> Not available through Windows, unless ''Special'' Permissions is used; not commonly used</translate>
 +
|-
 +
| style="text-align:center; border: solid thin; width: 5%" | '''1'''
 +
| style="border: solid thin; width: 8%;" | <translate><!--T:59--> '''Execute Only'''</translate>
 +
| style="border: solid thin; width: 30%;" | <translate><!--T:60--> Not available through Windows, unless ''Special'' Permissions is used; not commonly used</translate>
 
|}
 
|}
  
 +
<translate><!--T:61--> In comparison to Unix modes, when you see something like 644, break that into three elements:</translate>
  
===== Windows file permissions properties =====
+
'''6''' : '''4''' : '''4'''
Windows file permissions can be seen as having <strong><font color="#0000ff"></font>similar</strong> properties as UNIX or Linux file (Modes) permissions, they are just represented differently. For example, if you are primarily a Unix/Linux user, you are probably used to having permissions represented as 644/666 755/777, instead of being described in the terms above. So, when you are quoted to use 644 this equates to:</p><p>&nbsp;&nbsp; The owner of this file can read and write to it.
 
&nbsp;&nbsp; The owner's group can read the file.<br>
 
&nbsp;&nbsp; Everyone else can read the file.</em></p>
 
<p><strong><font color="#000000">* Note: </font></strong><font face="Times New Roman"><em>Windows and Unix permissions (Access Control Lists) do not equate exactly, as Windows does not use the "Groups" mechanism in the same manner. However, for this discussion and in regards to the Web-Hosting environment they can be summarily equated.</em></font><font face="Times New Roman"><em><strong>&nbsp;</strong></em></font></p>
 
<p><font face="Times New Roman"><em><strong>Ah, but</strong></em></font>,&nbsp; in windows "<em><strong>Groups</strong></em>" are not used and "<em><strong>Everyone</strong></em>" should have been removed.....</p>
 
<p>So this is where Windows and Unix do not quite equate, but what can be done is to "match" or "correlate" equivalent meanings. So this outline is not really going to provide you with a Windows or an NTFS specific permissions guide but more of an understanding of how the commonly quoted numbered UNIX/Linux style permissions correlate on a machine with an NTFS file system. </p><p>&nbsp; <br>
 
The files that are placed in the www or public_html root folder, or whatever directory your site (www.domain.com.au or localhost) points to on your hard drive should be owned by your user account, but only if that user is not what is considered as a privileged user like "Administrator" on Windows or "root" on UNIX/Linux. These accounts allow way too much access and should never be used for everyday use.</p><p><br>
 
  
===== Best Practices =====
+
<translate><!--T:62--> The first number represents the '''Owner''' permissions, the second represents the '''Group''' permissions and the third, the '''Other''' permissions.</translate>
Commonly used security practices suggest that all <strong>FILES</strong> should have the following permissions.</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <strong>Owner&nbsp; :</strong>&nbsp; Read &amp; Write</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <strong>Group&nbsp;&nbsp; :</strong>&nbsp; Read Only </p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <strong>Others :</strong> Read Only</p><p><br>
+
<translate><!--T:63-->
&nbsp;&nbsp;&nbsp; <strong>All DIRECTORIES/FOLDERS</strong> should have the following permissions.</p>
+
The Windows equivalent would be:</translate>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <strong>Owner&nbsp; :</strong> Read, Write &amp; Execute</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <strong>Group&nbsp;&nbsp; :</strong> Read &amp; Execute</p><p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <strong>Others :</strong> Read &amp; Execute</p><p><br><em>Arguably, this is not necessarily "optimum" security, but a balance must be struck between security, functionality and maintainability.</em></p><p>Windows, unlike Unix, does not maintain a single ACL for "Execute", but simply provides "Read &amp; Execute" combined, which does not imply "Write". The "Read &amp; Execute" ACL does however imply "List Directory Contents". Therefore, if you have only "Read &amp; Write" permissions on a directory but no "Execute" you will not be able to see the contents of the directory and may also have problems when attempting to run the file through a Web-Browser.</p><p><br>
+
<translate><!--T:70--> * '''Owner'''</translate> (6) <translate><!--T:64--> Read &amp; Write</translate>
Unfortunately, a little understanding of UNIX/Linux permissions is required to fully equate/correlate them to Windows permissions, the following "cheat-sheet" should assist;</p><p align="center">&nbsp;</p>
+
<translate><!--T:71--> * '''Group'''</translate> (4) <translate><!--T:65--> Read Only</translate>
{|  style="border-collapse: collapse" cellpadding="2" cellspacing="0" align="center" border="1" bordercolor="#000000" height="283" width="659"
+
<translate><!--T:72--> * '''Others'''</translate>(4) <translate><!--T:66--> Read Only</translate>
|  align="center" bgcolor="#cccccc" width="7%" valign="top" | <p><strong>Unix Mode</strong></p>
+
<translate><!--T:67--> Hopefully, this example provides some insight into how to correlate Unix Modes/Permissions into Windows Permissions/ACLs. This document does not include more complex subjects such as ''Effective'', ''Inherited'', or ''Special'' permissions. Despite Windows ease of use, Microsoft's Permissions and ACL mechanisms are actually reasonably complex and very extensive, but this might just give you a quick reference to try and alleviate some of the confusion surrounding Unix and Windows Permissions translations.</translate>
|  bgcolor="#cccccc" width="10%" valign="top" | <p><strong>Windows ACL&nbsp;</strong></p>
 
|  bgcolor="#cccccc" width="33%" valign="top" | <p><strong>Comments&nbsp;</strong></p>
 
|-
 
|  align="center" width="7%" valign="top" | <p><strong>7&nbsp;</strong></p>
 
|  width="10%" valign="top" | <p><strong>&nbsp;Modify&nbsp;</strong></p>
 
|  width="33%" valign="top" | <p><em>Read, Write &amp; Execute, you should be the owner of this file <br></em></p>
 
|-
 
|  align="center" width="7%" valign="top" | <p><strong>6</strong></p>
 
|  width="10%" valign="top" | <p><strong>&nbsp;Read &amp; Write<br></strong></p>
 
|  width="33%" valign="top" | <p><em>&nbsp;</em></p>
 
|-
 
|  align="center" width="7%" valign="top" | <p><strong>5</strong></p>
 
|  width="10%" valign="top" | <p><strong>&nbsp;Read &amp; Execute<br></strong></p>
 
|  width="33%" valign="top" | <p><em>used for most applications <br></em></p>
 
|-  
 
|  align="center" width="7%" valign="top" | <p><strong>4</strong></p>
 
|  width="10%" valign="top" | <p><strong>&nbsp;Read Only<br></strong></p>
 
|  width="33%" valign="top" | <p><em>security through obscurity is not a good practice <br></em></p>
 
|-  
 
|  align="center" width="7%" valign="top" | <p><strong>3</strong></p>
 
|  width="10%" valign="top" | <p><strong>&nbsp;Write &amp; Execute<br></strong></p>
 
|  width="33%" valign="top" | <p><em>not available through windows, unless "Special" Permissions is used, not commonly used <br></em></p>
 
|-
 
|  align="center" width="7%" valign="top" | <p><strong>2</strong></p>
 
|  width="10%" valign="top" | <p><strong>&nbsp;Write Only<br></strong></p>
 
|  width="33%" valign="top" | <p><em>not available through windows, unless "Special" Permissions is used, not commonly used <br></em></p>
 
|-
 
|  align="center" width="7%" valign="top" | <p><strong>1</strong></p>
 
|  width="10%" valign="top" | <p><strong>&nbsp;Execute Only<br></strong></p>
 
|  width="33%" valign="top" | <p><em>(not available through windows, unless "Special" Permissions is used, not commonly used) <br></em></p>
 
|}<div align="center"><br></div>
 
<p>So as a comparison example to Unix Modes, when you are quoted something like 644, you would now need to break that into three entities:</p>
 
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font color="#000000"><strong>6</strong></font>&nbsp; :&nbsp; <font color="#000000"><strong>4</strong></font>&nbsp; : <font color="#000000"><strong>4</strong></font></p>
 
<p> The first number represents the "<strong><font color="#000000">Owners</font></strong>" permissions, the second represents the "<font color="#000000"><strong>Group</strong></font>" permissions and the third, the "<strong><font color="#000000">Other</font></strong>" permissions.</p>
 
<p><br>
 
So the Windows equivalent would be something like;</p>
 
<p>&nbsp; <font color="#000000"><strong>Owner</strong></font> (6) : <strong>Read &amp; Write</strong></p>
 
<p>&nbsp; <font color="#000000"><strong>Group</strong></font> (4) : <strong>Read Only</strong></p>
 
<p>&nbsp; <strong><font color="#000000">Others </font></strong>(4) : <strong>Read Only</strong></p>
 
<p>&nbsp;</p><p> Hopefully, this example provides some insight into how to correlate Unix Modes/Permissions into Windows Permissions/ACL's. This document does not include more complex subjects such as "effective", "Inherited", or "Special" permissions. Despite Windows ease of use, Microsofts' Permissions and ACL mechanisms are actually reasonably complex and very extensive, but this might just give you a quick reference to try and alleviate some of the confusion surrounding Unix and Windows Permissions translations.</p>
 
  
<noinclude>[[Category:Installation FAQ]]
+
<noinclude>[[Category:Installation FAQ{{#translation:}}]]
[[Category:Security]]
+
[[Category:Security{{#translation:}}]]
[[Category:Server configurations]]
+
[[Category:Server configurations{{#translation:}}]]
[[Category:Security Checklist]]</noinclude>
+
[[Category:Security Checklist{{#translation:}}]]</noinclude>

Latest revision as of 17:21, 3 July 2022

Other languages:
English • ‎português do Brasil

Joomla and Windows File Permissions - Explanation[edit]

For those of you that are either developing or delivering your Joomla! websites from a Windows environment, it is sometimes difficult to obtain relevant information regarding permissions. Unfortunately, it is a fact that most Web-Serving is offered under Unix and that Unix is pretty well documented within this environment. Hopefully, the following information will go some way to clear up any confusion and provide a little guidance as well.

Windows Web Server Overview[edit]

First, let's discuss the differences between servers. In general, most Windows folks appear to be using either Apache (Win32) or Microsoft IIS. These two web servers operate very differently and utilize slightly different models of delivery. Apache (Win32) generally runs on the host computer as the User that it was installed under, whereas IIS installs under a specific user but will run under a newly installed user IUSR_.

Permission Defaults[edit]

By default, Unix tends to only give full access to the owning user to files and directories. In contrast, Windows by default will also assign the group Everyone full permissions. The first thing any good Windows Administrator will do is remove the rights of the Everyone group to improve security. For local PC testing, this is probably not necessary, but explains why, if Everyone is not removed and you run some form of permissions check script or the Joomla! Pre-Installation check, you will have full Read, Write and Execute permissions. You are acquiring the rights of the Everyone group.

Microsoft Internet Information Server (IIS)[edit]

IIS comes in two main flavors, PWS (Personal WebServer), and IIS (Internet Information Server). Essentially these are the same application. PWS is just a cut-down version of IIS designed for desktop environments, whereas IIS is designed for Server environments. PWS limits you to a single main website, so your application installations will generally be in sub-directories of the main website. IIS, on the other hand, provides the functionality for Virtual Hosts to be run from these directories, delivering multi-site capability.

Due to the different functionality limitations, PWS does not have the Permissions Wizard as it is determined to not be needed. Only one user will be using the PWS Server. In IIS, many users will be using the Server, thus differing permission assignments are needed.

Once the Everyone account is removed, Windows IIS is now left with the IUSR_* account having top-level rights to the Web-Server directories. A permissions check now should yield different results. Only the IUSR_* account has full permissions and other users should acquire either Read Only or no rights. Rights are determined by which other users have been assigned which rights to the IIS directories manually.

Assigning Permissions[edit]

Assigning permissions in Windows is reasonably straight forward, but can be a little confusing at times. Right-Click on the appropriate folder or file. Selecting Properties or Sharing and Security will enter the Windows Security Management pane. Selecting (click once) any user name listed will display the rights that user has in the bottom half of the pane. Some rights might be greyed out. These are unavailable, either because the current user (you are logged in as) does not have high enough permissions to alter them, or they are inherited from the directory above and have been set to use that higher level directory's permissions. (This is generally the default mechanism.)

As you can see, Windows utilizes the following Permissions/Rights scheme:

1 Full Control Allows: 1, 2, 3, 4, 5, 6, 7
2 Modify Allows: 2, 3, 4, 5, 6
3 Read & Execute Allows: 3, 4
4 List Folder Contents Allows: 4 (but cannot run programs)
5 Read Allows: 5 (Implies: 4)
6 Write Allows: 6 (Implies: 4 )
7 Special Permissions Allows: Combinations

Windows File Permissions Properties[edit]

Windows file permissions can be seen as having similar properties as UNIX or Linux file (Modes) permissions. They are just represented differently. For example, if you are primarily a Unix/Linux user, you are probably used to having permissions represented as 644/666 755/777, instead of being described in the terms above. So, when you use 644, this means:

  • The owner of this file can read and write to it.
  • The owner's group can read the file.
  • Everyone else can read the file.

Note Windows and Unix permissions (Access Control Lists) do not equate exactly; Windows does not use the Groups mechanism in the same manner. For this discussion and in regards to the web hosting environment, they can be equated. Ah, but in Windows Groups are not used and Everyone should have been removed. This is where Windows and Unix do not quite equate, but what can be done is to match or correlate equivalent meanings.

This outline is not really going to provide you with a Windows- or an NTFS-specific permissions guide but more of an understanding of how the commonly quoted numbered UNIX/Linux style permissions correlate on a machine with an NTFS file system. The files that are placed in the www or public_html root folder, or whatever directory your site (www.domain.com or localhost) points to on your hard drive should be owned by your user account, but only if that user is not what is considered as a privileged user such as Administrator on Windows or root on UNIX/Linux. These accounts allow way too much access and should never be used for everyday use.

Best Practices[edit]

Commonly used security practices suggest that all files should have the following permissions:

  • Owner Read & Write
  • Group Read Only
  • Others Read Only

All directories/folders should have the following permissions:

  • Owner Read, Write & Execute
  • Group Read & Execute
  • Others Read & Execute

Arguably, this is not necessarily optimum security, but a balance must be struck between security, functionality and maintainability. Windows, unlike Unix, does not maintain a single ACL for Execute, but simply provides Read & Execute combined, which does not imply Write. The Read & Execute ACL does however implies List Directory Contents. Therefore, if you have only Read & Write permissions on a directory but no Execute you will not be able to see the contents of the directory and may also have problems when attempting to run the file through a web browser. A little understanding of UNIX/Linux permissions is required to fully equate/correlate them to Windows permissions. The following table should assist:

Unix Mode Windows ACL Comments
7 Modify Read, Write & Execute, you should be the owner of this file
6 Read & Write
5 Read & Execute Used for most applications
4 Read Only Security through obscurity is not a good practice
3 Write & Execute Not available through Windows, unless Special Permissions is used; not commonly used
2 Write Only Not available through Windows, unless Special Permissions is used; not commonly used
1 Execute Only Not available through Windows, unless Special Permissions is used; not commonly used

In comparison to Unix modes, when you see something like 644, break that into three elements:

6 : 4 : 4

The first number represents the Owner permissions, the second represents the Group permissions and the third, the Other permissions. The Windows equivalent would be:

  • Owner (6) Read & Write
  • Group (4) Read Only
  • Others(4) Read Only

Hopefully, this example provides some insight into how to correlate Unix Modes/Permissions into Windows Permissions/ACLs. This document does not include more complex subjects such as Effective, Inherited, or Special permissions. Despite Windows ease of use, Microsoft's Permissions and ACL mechanisms are actually reasonably complex and very extensive, but this might just give you a quick reference to try and alleviate some of the confusion surrounding Unix and Windows Permissions translations.