How To Set a Password into a Web Folder (using TELNET) | |
SUMMARY The following document explains how to assign a password and login to access a web directory. IMPORTANT: Since you will be working at the root level of your directories make sure to follow the instructions correctly. If you fail to follow the instructions you may loose files, information or lock yourself out of a directory. The 1-2-3 summary steps to set a password and login to a directory are:
STEP 1 Find the Telnet SSH software on your computer. When you start it up, you'll see the following login screen. Change the Host to webdev.ndsu.nodak.edu as shown and choose OK.
Then you will be asked to login. Use your shortened UNIX ID to login. (Example: Instead of nancy.lilleberg, I would use nlillebe) The passphrase will be your usual NDSU Email password. --Click here to find out what your UNIX ID is --
STEP 2 Go to your WEB directory by typing: cd ndsu_web Go to the directory you would like to have password protected: cd directory List all your files in that directory: ls -la
STEP 3 Let's create a .htaccess file through vi (unix text editor): vi .htaccess
STEP 4 Type the following information in the .htaccess file: AuthUserFile /web/ndsu/login_name/folder/.htpasswd <Limit GET> where: /folder/ = is the folder or directory where you are and you want to have password protection. (In the following example, "pswd_protect")
NOTE: STEP 5 To save this .htaccess file you will type esc :wq and hit the return key.
STEP 6 Now, let's create a .htgroup file through vi (unix text editor): vi .htgroup Type the following information in the .htgroup file: MyGroup: username where: NOTE: This example uses just one login, comm261, to be possibly shared by a group such as students enrolled in that course. You can specify multiple username if desired and create a different password for each username. (MyGroup: username1 username2 )
STEP 7 To save this .htgroup file you will type esc wq and ihit the return key. STEP 8 To make sure that we have two files (.htaccess and .htgroup) in our protected directory let's type: ls -la You should see the two file names listed.
STEP 9 To create a password for each user name you will need to type the following: /web/bin/htpasswd.pl -u username where You will be prompted for the password. Type the desired password and hit the return key.
The password will be encrypted and as result a ".htpasswd" file will be generated by the system. NOTE: If you specified multiple usernames in step 6, you can define specific passwords for each username by repeating the /web/bin/htpasswd.pl -u username command for each username. STEP 10 To ensure that we have all three required documents with the names: .htaccess request another directory listing by typing: ls -la
STEP 11 When finished, type logout and hit the return key to leave the TELNET session, and then check your work by visiting your directory once there is a home page created in it.
| |