web:webprotect:authbyeecs_userdef
Differences
This shows you the differences between two versions of the page.
| web:webprotect:authbyeecs_userdef [2017/12/22 14:11] – created jas | web:webprotect:authbyeecs_userdef [2021/04/01 08:55] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 7: | Line 7: | ||
| % htpasswd -c / | % htpasswd -c / | ||
| - | This would prompt you to create | + | This would create a new password file called " |
| - | % htpasswd | + | % htpasswd |
| The password file should not be located in a directory that is served by the webserver. However, it must be a file that the webserver has permission to access. | The password file should not be located in a directory that is served by the webserver. However, it must be a file that the webserver has permission to access. | ||
| Line 37: | Line 37: | ||
| In the directory you wish to protect, create a .htaccess file with the following contents: | In the directory you wish to protect, create a .htaccess file with the following contents: | ||
| - | SSLRequireSSL | ||
| AuthType Basic | AuthType Basic | ||
| AuthName "Name of Web Area You Are Protecting" | AuthName "Name of Web Area You Are Protecting" | ||
| - | AuthBasicProvider file pam | + | AuthBasicProvider file ldap |
| AuthUserFile / | AuthUserFile / | ||
| Line 58: | Line 57: | ||
| Require user < | Require user < | ||
| - | |||
| - | If you wish to restrict access to specific system groups, add for each group: | ||
| - | |||
| - | Require unix-group < | ||
| If you wish to restrict access to specific user-defined groups, add: | If you wish to restrict access to specific user-defined groups, add: | ||
| Line 67: | Line 62: | ||
| Require group < | Require group < | ||
| - | Again, for simplicity, you can list all the groups on one line: | + | You can list multiple user-defined |
| - | Require unix-group < | ||
| Require group < | Require group < | ||
| - | If you only care about group alone, then you only need to add a " | + | If you wish to restrict access to specific EECS groups, add for each group <group>: |
| - | By default, only one of the conditions needs to be met to provide access, so if you were to add: | + | Require ldap-group cn=< |
| - | | + | You need 1 " |
| - | Require group guest | + | |
| - | Require | + | For example, to limit access to your page to users in the EECS groups " |
| + | |||
| + | Require ldap-group cn=faculty, | ||
| + | Require ldap-group cn=tech, | ||
| + | Require group faculty students | ||
| + | |||
| + | It's important to note that, by default, only **one** of the " | ||
| + | |||
| + | Surround your Require condition in a < | ||
| + | |||
| + | < | ||
| + | < | ||
| + | Require | ||
| + | Require | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | In the above case, only users who are members of both EECS groups | ||
| + | |||
| + | You can combine < | ||
| + | |||
| + | < | ||
| + | < | ||
| + | Require user fred sally bob | ||
| + | Require group mylab | ||
| + | < | ||
| + | Require ldap-group cn=faculty, | ||
| + | Require ldap-group cn=mylab, | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | You can also use < | ||
| - | ... then all user-defined users or system | + | < |
| + | < | ||
| + | Require valid-user | ||
| + | < | ||
| + | Require ldap-group cn=ugrad, | ||
| + | Require group mylab | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| - | If you wish to restrict access to specific system groups OR user-defined groups, simply remove the " | + | You can combine RequireAny, RequireAll, and RequireNone blocks in many ways including nesting them. |
| Check file permissions on your .htaccess file and directory permissions on all directories leading up to your .htaccess file. | Check file permissions on your .htaccess file and directory permissions on all directories leading up to your .htaccess file. | ||
web/webprotect/authbyeecs_userdef.1513969871.txt.gz · Last modified: by jas
