httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Boyle Owen" <>
Subject RE: htpasswd
Date Fri, 09 Aug 2002 10:17:54 GMT
>From: Philippe Dhont (Sea-ro) []
>I have a little problem;
>When i use
>Htpasswd -c /..../bla/blabla...
>I get the message:
>Htpasswd: -c and -n options conflict
>What's the cause of this? As i see it there is no connection 
>between -c and -n

You see wrong. "-c" means create a file and put the user/pass pairs in it. "-n" means send
the output to STDOUT. How can the program do both? They are mutually exclusive...

The normal procedure is:

- Make a file to begin with:

htpasswd -c mypasswords.pwd joe
	<type in password for joe>

this creates the file mypasswords.pwd with one user/pass pair (i.e. joe) inside.

- Later on, add more users:

htpasswd mypasswords.pwd jim
	<type in password for jim>

Note that there is now no "-c" switch since you no longer need to create the file since it
now exists. The user/pass for jim will be appended to the file which now contains a user/pass
pair for joe and jim.

If you use the "-n" option, you get the user/pass pair on STDOUT (this lets you use htpasswd
as a system call in a pipeline or shell-script or anything else), e.g.

htpasswd -n joe
	<type in password for joe>

or all on the commandline (add the "-b" switch).

htpasswd -nb joe abcwxyz


Owen Boyle

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message