You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 19, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: _includes/install/file-system-perms-twouser_22.md
+20-8Lines changed: 20 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,10 @@ To enable the web server to write files and directories in the Magento file syst
12
12
13
13
This section discusses how to create a new Magento file system owner and put that user in the web server's group. You can use an existing user account if you wish; we recommend the user have a strong password for security reasons.
14
14
15
+
<divclass="bs-callout bs-callout-info">
16
+
Skip to <a href="#install-update-depend-user-findgroup">step 2</a> if you plan on using an existing user account.
17
+
</div>
18
+
15
19
### Step 1: Create the Magento file system owner and give the user a strong password {#mage-owner-create-user}
16
20
This section discusses how to create the Magento file system owner. (Magento file system owner is another term for the *command-line user*.)
17
21
@@ -35,7 +39,7 @@ For example, to create a user named `magento_user` and give the user a password,
35
39
sudo passwd magento_user
36
40
37
41
<divclass="bs-callout bs-callout-warning">
38
-
<p>Because the point of creating this user is to provide added security, make sure you create a <a href="https://en.wikipedia.org/wiki/Password_strength" target="_blank">strong password</a>.</p>
42
+
<p>Because the point of creating this user is to provide added security, make sure you create a <a href="https://en.wikipedia.org/wiki/Password_strength" target="_blank">strong password</a>.</p>
39
43
</div>
40
44
41
45
### Step 2: Find the web server user's group {#install-update-depend-user-findgroup}
@@ -51,20 +55,28 @@ To find the web server user's group:
51
55
### Step 3: Put the Magento file system owner in the web server's group {#install-update-depend-user-add2group}
52
56
To put the Magento file system owner in the web server's primary group (assuming the typical Apache group name for CentOS and Ubuntu), enter the following command as a user with `root` privileges:
The `-a -G` options are important because they add `apache` or `www-data` as a _secondary_ group to the user account, which preserves the user's _primary_ group. Adding a secondary group to a user account helps [restrict file ownership and permissions](#perms-set-two-users) to ensure members of a shared group only have access to certain files.
63
+
</div>
56
64
57
65
For example, to add the user `magento_user` to the `apache` primary group on CentOS:
58
66
59
-
usermod -g apache magento_user
67
+
usermod -a -G apache magento_user
60
68
61
69
To confirm your Magento user is a member of the web server group, enter the following command:
62
70
63
-
groups <user name>
71
+
groups magento_user
72
+
73
+
The following sample result shows the user's primary (`magento`) and secondary (`apache`) groups.
0 commit comments