University Systems help centre
Restrict access to your website: Mac OS X
By default, UVic web spaces are visible to the public. For security reasons, you may want to restrict access to your personal website.
There are three restriction types:
- Only allow users with a valid NetLink ID to access your site.
- Only allow users with particular NetLink IDs to access your site.
- Only allow users who know a set username and password to access your site.
These restrictions will make an authentication box appear when visitors navigate to your website (the appearance may differ depending on your web browser).

Only allow users with a valid NetLink ID to access your site
- Open a text editing application, such as
TextEdit. If you are using TextEdit,
you will need to click
Format and select
Make Plain Text.

- Type the following text (as it appears in the image
below):

- You may change the text Restricted to UVic NetLink to anything you wish to appear in the login dialogue.
- Save your file as
.htaccess. Deselect the
If no extension is provided...
checkbox. Since by default Mac OS X hides files
beginning with periods, you may not be able to see the
file no your computer. You should, however, be able to
see the file when using an SFTP client such as
FileZilla.

- Upload the file (using an SFTP client) to the folder that you wish to protect. All subfolders will be protected. If you wish to protect your entire site, upload the file to the www folder.
- File permissions to
.htaccess should allow read access to
all users.


- To remove or change access restrictions, delete or edit your .htaccess file.
Only allow users with particular NetLink IDs to access your site
- Open a text editing application, such as TextEdit.
- Type the following text (as it appears in the image
below):

- Instead of typing NetLinkA NetLinkB and NetLinkC, type the NetLink ID(s) that may access your site.
- You may change the text Restricted to UVic NetLink to anything you wish to appear in the login dialogue.
- Save your file as
.htaccess. Deselect the
If no extension is provided...
checkbox. Since by default Mac OS X hides files
beginning with periods, you may not be able to see the
file on your computer. You should, however, be able to
see the file when using an SFTP client, such as
FileZilla.

- Upload the file (using an SFTP client) to the folder that you wish to protect. All subfolders will be protected. If you wish to protect your entire site, upload the file to the www folder.
- File permissions to
.htaccess should allow read access.


- To remove to change access restrictions, delete or edit your .htaccess file.
Only allow users who know a set username and password to access your site
- Open a text editing application, such as TextEdit.
- Type the following text (as it appears in the image
below):

- Instead of typing YourNetLink, type your personal NetLink ID.
- Instead of typing userA userB and userC, type the custom username(s) that may access your site. Make usernames unique! If you choose a username that already exists as a NetLink ID, the password will default to the NetLink ID's password.
- You may change the text Restricted to UVic NetLink to anything you wish to appear in the login dialogue.
- Save your file as
.htaccess. Deselect the
If no extention is provided...
checkbox. Since by default Mac OS X hides files
beginning with periods, you may not be able to see the
file on your computer. You should, however, be able to
see the file when using an SFTP client, such as
FileZilla.

- Upload the file (using an SFTP client) to the folder that you wish to protect. All subfolders will be protected. If you wish to protect your entire site, upload the file to the www folder.
- Use the
Terminal application to SSH into your
unix.uvic.ca account.
- Type ssh yourNetLinkID@unix.uvic.ca and hit enter. Then enter your password.
- Use the htpasswd command to assign passwords to your custom list of usernames. When in your home directory, enter the command htpasswd �c .htpasswd userA. (Ensure the username matches the Require user name in your .htaccess file.)
- You will be prompted twice to enter a password for the username.
- For additional users, type htpasswd .htpasswd userB.
- File permissions of .htaccess should be readable
and executable.

- To remove or change access restrictions, delete or edit your .htaccess file.







