Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 ...

share|improve this question

2 Answers 2

up vote 13 down vote accepted

Try yum provides \*bin/htpasswd

share|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

It's yum install httpd-tools. Just found it today.

share|improve this answer
2  
In CentOS at least, httpd-tools does provide htpasswd. I found it using yum provides \*bin/htpasswd ;) Great way to get htpasswd without installing the httpd server (often not desirable if you're running another web server already, or don't want to run a web server) –  Doktor J Mar 31 at 15:31
1  
RHEL6 - # yum install httpd-tools does have htpasswd utility. Run yum provides *bin/htpasswd, and it will show that https-tools provides the htpasswd utility. –  xpro-fedtest Aug 6 at 17:38

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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