For apache, there is the htpasswd utility, which can be used to generate encrypted passwords for .htaccess access restriction etc. In Ubuntu I can install it via the apache2-utils package, but in Scientific Linux (Red Hat) I find only the following package, when I do yum search htpasswd:

perl-Apache-Htpasswd.noarch : Manage Unix crypt-style password file

but this does not seem to be the package I'm looking for, since it does not include the htpasswd command, and also when I do apt-cache search htpasswd in Ubuntu, I get:

libapache-htpasswd-perl - Manage Unix crypt-style password file
lighttpd - A fast webserver with minimal memory footprint
nanoweb - HTTP server written in PHP
apache2-utils - utility programs for webservers

... where the first one is quite obviously the one corresponding to the one I found for Red Hat above(?).

So, is there any equivalent to the apache2-utils package, or any other package including the htpassd utility, for Red Hat/Scientific Linux? At least I can't find it ...

link|improve this question

50% accept rate
feedback

1 Answer

up vote 3 down vote accepted

Try yum provides \*bin/htpasswd

link|improve this answer
But don't forget to escape the wildcard. – Ignacio Vazquez-Abrams Apr 14 '11 at 5:37
Ah, thanks! (Even better than just providing the answer ... helping me to help myself :)). So ... turns out that it is provided with the httpd package itself. Well, that explains it. (Was trying to use the htpasswd from a server which did not have apache installed, but only the file system to be published on www ...) – Samuel Lampa Apr 14 '11 at 5:41
@Ignacio: Worked without escaping too ... but maybe that depends on which shell you run ... – Samuel Lampa Apr 14 '11 at 5:43
I learned something too, although to be honest I don't know why you're supposed to. It appears to work without escaping in CentOS 5.6, but I guess there's another reason for it. – emgee Apr 14 '11 at 5:43
It all depends on whether or not something matches the pattern you use. mkdir -p bogusbin/htpasswd – Ignacio Vazquez-Abrams Apr 14 '11 at 5:52
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.