You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by David <am...@starhub.net.sg> on 2003/09/10 02:57:06 UTC
[users@httpd] Creating a password from an excel or text file
Hi!!
I understand to create a user ID and password for the basic
authentication for my web server requires me to enter the each and every
user name-password sets from the command prompts.
Suppose I have some 250 user accounts with different passwords to be
created. How can I do this ? Can I tell htpasswd.exe to read the user
ID and password information from the file (say an Excel or just a simple
text file delimited by tabs).
Many thanks for your time and attention.
Warmest Regards
David
RE: [users@httpd] Creating a password from an excel or text file
Posted by David <am...@starhub.net.sg>.
Hi guys,
Many thanks for your replies and help.
I used java to solve my problem in the end.
I used java to read in the data (some 300 user ID and password pairs)
from an excel file. The java programme will then write to a file with
the correct syntax for the .bat file.
The end result is a .bat file written by java with all the correct
syntax.
This java program also runs this batch file as soon as it completes
writing the .bat file.
The .htpasswd is also created as required (with the 300++ user ID and
password pairs).
Thanks again for your help!
Regards
David
-----Original Message-----
From: Jeff White [mailto:jlwpc1@earthlink.net]
Sent: Friday, September 12, 2003 1:01 AM
To: users@httpd.apache.org
Subject: Re: [users@httpd] Creating a password from an excel or text
file
From: "David"
> Hi!!
>
> I understand to create a user ID and password for the basic
> authentication for my web server requires me to enter the each and
every
> user name-password sets from the command prompts.
>
> Suppose I have some 250 user accounts with different passwords to be
> created. How can I do this ? Can I tell htpasswd.exe to read the
user
> ID and password information from the file (say an Excel or just a
simple
> text file delimited by tabs).
>
See:
Read a Text File into an Array
http://www.microsoft.com/technet/scriptcenter/filefolder/scrff58.asp
Read Data from a Text File
http://www.microsoft.com/technet/scriptcenter/entscr/scrent11.asp
Then call the password program like below:
Using the below link, skip down to this part:
The ability to run command-line tools
WSH Overview
http://www.microsoft.com/technet/scriptcenter/scrguide/sas_wsh_qlcc.asp
For tons of information and for usage with Excel:
http://groups.google.com/groups?q=excel+read+group:*scripting
http://groups.google.com/groups?q=read+file+group:*scripting
Microsoft Script Center
http://www.microsoft.com/technet/scriptcenter/default.asp
Windows 2000 Scripting Guide
Microsoft Windows 2000 Scripting Guide
http://www.microsoft.com/technet/scriptcenter/scrguide/sagsas_overview.a
sp
System Administration Scripting Guide - samples scripts
http://www.microsoft.com/downloads/release.asp?ReleaseID=38942
Windows Script Host 5.6 documentation download
http://www.microsoft.com/downloads/details.aspx?FamilyId=01592C48-207D-4
BE1-8A76-1C4099D7BBB9&displaylang=en
Jeff
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server
Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Creating a password from an excel or text file
Posted by Jeff White <jl...@earthlink.net>.
From: "David"
> Hi!!
>
> I understand to create a user ID and password for the basic
> authentication for my web server requires me to enter the each and
every
> user name-password sets from the command prompts.
>
> Suppose I have some 250 user accounts with different passwords to be
> created. How can I do this ? Can I tell htpasswd.exe to read the
user
> ID and password information from the file (say an Excel or just a
simple
> text file delimited by tabs).
>
See:
Read a Text File into an Array
http://www.microsoft.com/technet/scriptcenter/filefolder/scrff58.asp
Read Data from a Text File
http://www.microsoft.com/technet/scriptcenter/entscr/scrent11.asp
Then call the password program like below:
Using the below link, skip down to this part:
The ability to run command-line tools
WSH Overview
http://www.microsoft.com/technet/scriptcenter/scrguide/sas_wsh_qlcc.asp
For tons of information and for usage with Excel:
http://groups.google.com/groups?q=excel+read+group:*scripting
http://groups.google.com/groups?q=read+file+group:*scripting
Microsoft Script Center
http://www.microsoft.com/technet/scriptcenter/default.asp
Windows 2000 Scripting Guide
Microsoft Windows 2000 Scripting Guide
http://www.microsoft.com/technet/scriptcenter/scrguide/sagsas_overview.asp
System Administration Scripting Guide - samples scripts
http://www.microsoft.com/downloads/release.asp?ReleaseID=38942
Windows Script Host 5.6 documentation download
http://www.microsoft.com/downloads/details.aspx?FamilyId=01592C48-207D-4BE1-8A76-1C4099D7BBB9&displaylang=en
Jeff
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Creating a password from an excel or text file
Posted by Leif W <wa...@usa.net>.
Please post in plain text to the list.
Apache's htpasswd will not do this, no. Doing something like this would
require at least a small amount of programming on your part. At the very
least, dump all the usernames and passwords to a plain text file, one per
line, like this format:
user1 pass1
user2 pass2
user3 pass3
Then use a text editor like TextPad or UltraEdit, which can do REGEX
(Regular Expression patterm matching and replacement), and do a search and
replace for "^(.*)" with "htpasswd .htpasswd \1". This will replace every
line with the appropriate htpasswd command. Change the first command to add
the -c flag. Save this to some .bat file (pw-gen.bat). It should look like
this when done:
htasswd -c .htpasswd user1 pass1
htasswd .htpasswd user2 pass2
htasswd .htpasswd user3 pass3
Then go set up your .htpasswd and .htaccess files accordingly. (Check
todays archives as I've just explained this in depth).
Leif
----- Original Message -----
From: David
To: HTTP Server Users
Sent: Tuesday, September 09, 2003 8:57 PM
Subject: [users@httpd] Creating a password from an excel or text file
Hi!!
I understand to create a user ID and password for the basic authentication
for my web server requires me to enter the each and every user name-password
sets from the command prompts.
Suppose I have some 250 user accounts with different passwords to be
created. How can I do this ? Can I tell htpasswd.exe to read the user ID
and password information from the file (say an Excel or just a simple text
file delimited by tabs).
Many thanks for your time and attention.
Warmest Regards
David
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Creating a password from an excel or text file
Posted by Paul Coldrey <pa...@ensigma.com.au>.
If you're running Apache 2.0 then it supports GDBM files for
user/passwords/groups. Many programs have nice functions for
manipulating GDBMs (I'd use PHP - Perl / Python would also be good
options). The Apache documentation tells you what to enter for the
keys/values in a GDBM file. If you have an Excel file then export it as
a CSV and this should be really easy to read with any of the above
languages. You can use dbmmanage to check whether the data in the file
you create is OK.
Cheers,
Paul
David wrote:
> Hi!!
>
>
>
> I understand to create a user ID and password for the basic
> authentication for my web server requires me to enter the each and
> every user name-password sets from the command prompts.
>
>
>
> Suppose I have some 250 user accounts with different passwords to be
> created. How can I do this ? Can I tell htpasswd.exe to read the
> user ID and password information from the file (say an Excel or just a
> simple text file delimited by tabs).
>
>
>
> Many thanks for your time and attention.
>
>
>
> Warmest Regards
>
> David
>
>
>