Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2009-12

input password htpasswd

4 messages · 4 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

faread_w

everybody,please help me.i have case for use lazarus.i use linux fedora. i use htpasswd for cretead user and password. if i use open termina concole i just type
/usr/bin/htpasswd -c tipe-file User
Add password: *****
Retype Password:*****

so if i use program lazarus,how to enter/input password htpasswd by using script on lazarus?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20091202/085125ed/attachment.html>

Reply by email

Michael Van Canneyt
to faread_w
faread_w wrote 8 lines
everybody,please help me.i have case for use lazarus.i use linux fedora. i use htpasswd for cretead user and password. if i use open termina concole i just type /usr/bin/htpasswd -c tipe-file User Add password: ***** Retype Password:***** so if i use program lazarus,how to enter/input password htpasswd by using script on lazarus?

htpasswd supports a -b option, so you can do

ExecuteProcess('/usr/bin/htpasswd','-b -c tipe-file user password');

Michael.

Reply by email

waldo kitty
to Michael Van Canneyt
Michael Van Canneyt wrote
On Wed, 2 Dec 2009, faread_w wrote:

[trim]

Show quoted text 6 lines
> so if i use program lazarus,how to enter/input password htpasswd by > using script on lazarus? htpasswd supports a -b option, so you can do ExecuteProcess('/usr/bin/htpasswd','-b -c tipe-file user password');

with that in mind, htpasswd also supports what? two or three modes of encoding/encrypting the passwords? crypt, md5, sha and plaintext...

it has been a while since i've played with creating passwords for htpasswd files and i didn't have a native binary for my chosen OS to do it with... i had to use other tools until i found the one that generated the proper output for me to place in the htpasswd file... sadly, that was some years ago and i don't recall how i did it but ii do recall that the crypt function is what it required in my case...

once the algorithm is known, it is a simple matter for a fpc or laz/fpc app to do the work directly... the md5 option is modified for apache so that should be easily available via the apache sources... the other methods should also be as easy to come by... if i'm reading correctly, the md5 format is used by default on windows, netware and tpf (whatever that is)... other platforms use crypt()...

now, i'm wondering why the example is wiping out the file and starting it over instead of removing the user's password and generating a new one... sounds like there's only one user listed in the file ;)

Reply by email

Mattias Gaertner
to Michael Van Canneyt: htpasswd supports a -b option, so you can do ExecuteProcess('/usr/bin/htpasswd','-b -c…
Show quoted text 16 lines
On Wed, 2 Dec 2009, faread_w wrote: > everybody,please help me.i have case for use lazarus.i use linux fedora. i use htpasswd for cretead user and password. > if i use open termina concole i just type > /usr/bin/htpasswd -c tipe-file User > Add password: ***** > Retype Password:***** > > > so if i use program lazarus,how to enter/input password htpasswd by using script on lazarus? htpasswd supports a -b option, so you can do ExecuteProcess('/usr/bin/htpasswd','-b -c tipe-file user password');

For security reasons you should never put passwords at the command line. Pipe the passwords instead or create the .htaccess yourself.

Mattias

Reply by email