Difference between revisions of "User:Djgreen/htpasswd"

From WolfTech
Jump to navigation Jump to search
m
 
m
Line 8: Line 8:
 
1. Using Putty, ssh to ssh.ncsu.edu (Add/Remove programs, add new prgm, communications, Putty) 2. Change to the AEMP directory
 
1. Using Putty, ssh to ssh.ncsu.edu (Add/Remove programs, add new prgm, communications, Putty) 2. Change to the AEMP directory
  
cd /afs/eos/engrwww/aemp
+
  cd /afs/eos/engrwww/aemp
  
 
3. Edit the htpass file.
 
3. Edit the htpass file.
  
htpasswd.dat -c ./.htpass djgreen
+
  htpasswd.dat -c ./.htpass djgreen
  
 
If .htpass already exists, drop the "-c".
 
If .htpass already exists, drop the "-c".
Line 21: Line 21:
  
 
Just for reference the contents of the .htaccess file are:
 
Just for reference the contents of the .htaccess file are:
 
+
<pre>
 
AuthType Basic
 
AuthType Basic
 
AuthUserFile /afs/eos/engrservers/www/aemp/NSEC/.htpass
 
AuthUserFile /afs/eos/engrservers/www/aemp/NSEC/.htpass
 
AuthName "Password Required"
 
AuthName "Password Required"
 
require valid-user
 
require valid-user
 
+
</pre>
 
One thing to note. When you tell it where to find the paswd file, you MUST use the full afs path and use /engrservers/www/ in place of /engrwww/ .
 
One thing to note. When you tell it where to find the paswd file, you MUST use the full afs path and use /engrservers/www/ in place of /engrwww/ .
 
Relative paths will not see it.
 
Relative paths will not see it.

Revision as of 10:49, 30 June 2006

ok. This is what I've done. In each of those directories, I've placed the following files: .htpass / .htaccess / and htpasswd.dat .

The first will contain all of the usernames and paswds you create. The second tells the webbrowser, STOP and chk if the person is in .htpass The third allows you to add and remove people from .htpass.

Procedure to edit .htaccess:

1. Using Putty, ssh to ssh.ncsu.edu (Add/Remove programs, add new prgm, communications, Putty) 2. Change to the AEMP directory

  cd /afs/eos/engrwww/aemp

3. Edit the htpass file.

  htpasswd.dat -c ./.htpass djgreen

If .htpass already exists, drop the "-c".

That creates or adds a user to the paswd file.

4. To remove a user, simply edit the .htpass file using either "vi" or "pico" and delete the line that user is on.

Just for reference the contents of the .htaccess file are:

AuthType Basic
AuthUserFile /afs/eos/engrservers/www/aemp/NSEC/.htpass
AuthName "Password Required"
require valid-user

One thing to note. When you tell it where to find the paswd file, you MUST use the full afs path and use /engrservers/www/ in place of /engrwww/ . Relative paths will not see it.