Search code examples
.htaccessdrupalhashdrupal-7.htpasswd

Reuse drupal password hashes in htpasswd


I have an existing Drupal 7 database with password hashes like this:

U$S$92keK3LGE6O3i/yZoftycq9AXzAlwGPqn3nfn2gRO6z6U0Q.9IPM
U$S$9SStyGBYv95n.yfhyZzNdHggooRGOxem6zgbDreZO34LgxLYQN5z
...

I want to temporarily re-use these login accounts for a htpasswd protected static page on another server. I understand Drupal uses sha-512 but htpasswd only supports sha-1 (and crypt + md5).

Is there a way I can use these hashes with htpasswd?


Solution

  • It's theoretically possible if you fancy recompiling htpasswd to pass the Drupal salt to the glibc2 version of crypt with an ID of 6. I wouldn't suggest it is feasible.