HTTP Authentication example & run through - part 2 |
Part: 1 2 3 |
We want to to change into the tutor directory so we'll type cd tutor, then we'll list the contents with ls...
Then into the keeper directory...
Now there's a lot of stuff in this directory so here's a capture of the SimpTerm window scrolled up a little. We want in the mystash directory.
cd into mystash, then ls to display the contents
This is the directory that we want to password protect...
The first order of business is to create a .htaccess file for that directory. We'll do that with pico, the UNIX text editor and Notepad, the Windows text editor. First, copy the following into Notepad...
AuthUserFile fullpath/.htpasswd AuthName "My Secret Area" AuthGroupFile /dev/null AuthType Basic require valid-user |
You can change "My Secret Area" to whatever you want. It just identifies this password area by name. It is also what appears in the login dialog for this area.
Now, with SimpTerm we'll get the full path of the directory we want to protect. Type pwd...
The output is the full UNIX path. Select and copy it to the clipboard...
Now paste it into Notepad in place of "fullpath"...
Now just hang on to this for a minute.
Now, in SimpTerm, crank up pico by typing pico...
Copy the entire bit that we did in Notepad...
And paste it into pico...
Now save this as .htaccess
Do this by pressing CTRL+O and typing in .htaccess
File is saved.
Exit out of pico by pressing CTRL+X...