[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [cobalt-users] htpasswd authentication



The following are from cobalt's (sun) support site. If they don't solve your problem, please let us know. As apache is apache, you may need to create a new passwd file, depending on the environment you came from.

http://cobalt-knowledge.sun.com/cgi-bin/kbase.cfg/php/enduser/std_adp.php?p_sid=As5fci6g&p_lva=&p_refno=010608-002536&p_created=992013163&p_sp=cF9ncmlkc29ydD0mcF9yb3dfY250PTYmcF9zZWFyY2hfdGV4dD0uaHRhY2Nlc3MgJnBfc2VhcmNoX3R5cGU9MyZwX3Byb2RfbHZsMT1_YW55fiZwX3Byb2RfbHZsMj1_YW55fiZwX2NhdF9sdmwxPX5hbnl_JnBfY2F0X2x2bDI9fmFueX4mcF9zb3J0X2J5PWRmbHQmcF9wYWdlPTE*&p_li=

Although we do not have this feature on the browser interface, a telnet session will allow this to be done. For this example, we will show you how to password protect a site web page. You can apply this procedure to user sites also by changing the directories.

1. Telnet in, and login as the user.
2. Create the .htaccess file, it should contain at least the following lines:

require valid-user
Authname "My Protected Page"
Authtype Basic
AuthUserFile /home/sites/sitename/web/.htpasswd

NOTE: The AuthUserFile should be in the directory that you want to password protect. The above example shows how to protect the 'sitename' site.

3. Now we want to create the htpasswd file using the htpasswd command in the /usr/sbin/ directory. type:
/usr/sbin/htpasswd -c /home/sites/home/users/.htpasswd username

It will prompt you for the password twice
NOTE: The -c flag in this command signifies that it must create the file. To add further users to the htpasswd file, repeat the same command WITHOUT the -c flag


http://cobalt-knowledge.sun.com/cgi-bin/kbase.cfg/php/enduser/std_adp.php?p_sid=As5fci6g&p_lva=&p_refno=010608-002370&p_created=992013163&p_sp=cF9ncmlkc29ydD0mcF9yb3dfY250PTYmcF9zZWFyY2hfdGV4dD0uaHRhY2Nlc3MgJnBfc2VhcmNoX3R5cGU9MyZwX3Byb2RfbHZsMT1_YW55fiZwX3Byb2RfbHZsMj1_YW55fiZwX2NhdF9sdmwxPX5hbnl_JnBfY2F0X2x2bDI9fmFueX4mcF9zb3J0X2J5PWRmbHQmcF9wYWdlPTE*&p_li=
Although we do not have a browser interface to allow this feature, it can be done with a telnet session.

Below is a very generic example of an .htaccess file. You will need modify it according to your situation's needs. For this example, we will show how to password protect a users Web page. You can apply this procedure to virtual sites also by changing the directories.

·       Telnet in, and login as the User or admin

·       Navigate to the directory you want to password protect.

·       Create the .htaccess file, it should contain the following lines:

# Access file
order allow,deny
allow from all
require valid-user
Authname DirectoryName
AuthPAM_Enabled off
Authtype Basic
AuthUserFile /home/sites/sitename/web/directory/.htpasswd

Replace sitename and directory as appropriate.



· If you are using the server's /etc/passwd file then the last line of the .htaccess should be:
AuthUserFile /etc/passwd
· If you are not using the server's /etc/passwd file,(limits access to legit usernames on the server) you must create the .htpasswd file using the htpasswd tool.

· Type the following command to create the file and add a user: /usr/bin/htpasswd -c .htpasswd username
·       You will be prompted for the users' password twice.
· If you need to add additional users to the file, use the command above without the -c.

Please remember that the above example is generic, it will need to be changed to suit your specific needs. Please refer to the extensive documentation available at Apache's web site for information to assist you in creating the file to suit your needs.


At 6/5/2001 11:42 PM, you wrote:
I am trying to password protect a (web) directory called admin.

Below is my .htaccess for the admin directory:
---------------------------------------------------------
AuthUserFile /home/sites/sitex/etc/passwd
AuthGroupFile /dev/null
AuthName Admin
AuthType Basic

#order deny,allow
#deny from all
#allow from xxx.xx.xx.xxx

require valid-user
---------------------------------------------------------


I am getting below error:
------------------------------------------------------
[error] (2)No such file or directory: access to /admin/ failed for xxx.xxx.xxx.xx,
reason: User not known to the underlying authentication module
-------------------------------------------------------

http://www.cobalt.com/support/kb/search.php3?ques=htaccess&qid=518&language=1

Regards,

Glen Scott

_______________________________________________
cobalt-users mailing list
cobalt-users@xxxxxxxxxxxxxxx
To Subscribe or Unsubscribe, please go to:
http://list.cobalt.com/mailman/listinfo/cobalt-users