web:password-protected:simplifyauth:start
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
web:password-protected:simplifyauth:start [2017/01/30 11:37] – jas | web:password-protected:simplifyauth:start [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ======Simplifying Authentication with mkhtaccess | ||
- | |||
- | As you have seen in the other documents in this section, in order to protect your web site using password authentication, | ||
- | |||
- | Here are the mkhtaccess command-line options: | ||
- | |||
- | < | ||
- | -a < | ||
- | -d < | ||
- | -f - force output file to be overwritten if it exists | ||
- | -g < | ||
- | -G < | ||
- | -o < | ||
- | -u < | ||
- | -U < | ||
- | -S - use system password file/group file | ||
- | </ | ||
- | |||
- | The best way to look at how mkhtaccess works is with a few simple examples. | ||
- | |||
- | Create an .htaccess file for a web site that permits access to anyone with a valid account on our systems: | ||
- | |||
- | % mkhtaccess -S -o .htaccess | ||
- | |||
- | Create an .htaccess file for a web site that permits access to only users in group faculty or tech, or system user ulya: | ||
- | |||
- | % mkhtaccess -S -g faculty -g tech -u ulya -o .htaccess | ||
- | |||
- | Taking the last example, now allow all EECS3401M students to access the site as well: | ||
- | |||
- | % mkhtaccess -S -g faculty -g tech -d / | ||
- | |||
- | Why not add EECS3421M students as well? | ||
- | |||
- | % mkhtaccess -S -g faculty -g tech -d / | ||
- | |||
- | mkhtaccess will also work with web sites that implement ONLY user-defined usernames and passwords and groups. | ||
- | |||
- | Allow any user in the user-defined password file / | ||
- | |||
- | % mkhtaccess -U / | ||
- | |||
- | You can even combine both user-defined usernames and passwords and system-defined usernames and passwords or groups. For example, to allow all users in 3421M or users defined in the password file "/ | ||
- | |||
- | % mkhtaccess -S -U / | ||
- | |||
- | As you can see, mkhtaccess can be used to build any of the .htaccess files referred to in the web documentation on Password-Protecting Web Areas. If you have needs that differ, you can always create your .htaccess file manually. | ||
- | |||
- | Full details on Apache authentication can be found in the Apache authentication documentation. | ||
- | |||
- | Notes | ||
- | |||
- | * If your .htaccess file already exists, and you are rebuilding it, use the -f flag to mkhtaccess to overwrite the file. | ||
- | |||
- | * You must specify -S, -U, and -G options to mkhtaccess before -d, -g, or -u. | ||
- | |||
- | * If you do not specify any users, groups, or distribution lists, any valid user will be allowed access. | ||
- | |||
- | * When specifying the paths to a user-defined password file, group file, or even distribution lists, you can use relative paths. The program will convert them to absolute paths. | ||
- | |||
- | * If you intend on protecting your web site using course distribution lists, please keep a few things in mind: | ||
- | * The distribution lists are updated on a daily basis, so you will need to re-update your .htaccess file on a daily basis. | ||
- | * In order to schedule automatic updates to your .htaccess file, please see the system manual pages for cron and crontab. | ||
- | * If you automate the daily rebuild of your .htaccess file through cron, keep in mind that you probably want to use the distribution files in / | ||
web/password-protected/simplifyauth/start.1485794273.txt.gz · Last modified: 2017/01/30 11:37 by jas