You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Jim Klo <ji...@sri.com> on 2012/06/07 23:14:30 UTC

Migrate htpasswd users to _users?

Wondering if there is a way to easily migrate a flat file of htpasswd users into couchdb _users?

htpasswd typically uses crypt() which I think i based off a MD5, and couchdb uses SHA1.

So essentially is there a stable authentication handler out there that replicates htpasswd?

Thanks,

- Jim

Jim Klo
Senior Software Engineer
Center for Software Engineering
SRI International


Re: Migrate htpasswd users to _users?

Posted by Keith Gable <zi...@ignition-project.com>.
Well what I'm trying to say is crypt() won't work. You'll have to use the
APR-specific crypt() or a clone implementation. I remember seeing one in
Python on the nginx wiki.
On Jun 7, 2012 10:48 PM, "Jim Klo" <ji...@sri.com> wrote:

> As we're using whatever the default is on Ubuntu (which is crypt() per
> manpage http://linux.die.net/man/1/htpasswd)
>
> Is there an existing authentication handler plugin that uses crypt? While
> I'm not even close to even call myself an Erlang noob - from here it
> doesn't seem like it would too difficult to alter
> https://github.com/apache/couchdb/blob/1.2.x/src/couchdb/couch_httpd_auth.erlbut have no idea  where to start on modifying as a plugin.
>
> Worst case I just make all my users reset their passwords.
>
> - Jim
>
>
> Sent from my iPad
>
> On Jun 7, 2012, at 7:12 PM, "Keith Gable" <zi...@ignition-project.com>
> wrote:
>
> > htpasswd supports several different hash schemes. $apr1$ is the default
> and
> > isn't very portable (though is supported by nginx) because it's not
> exactly
> > MD5 as generated by crypt().
> > On Jun 7, 2012 4:15 PM, "Jim Klo" <ji...@sri.com> wrote:
> >
> >> Wondering if there is a way to easily migrate a flat file of htpasswd
> >> users into couchdb _users?
> >>
> >> htpasswd typically uses crypt() which I think i based off a MD5, and
> >> couchdb uses SHA1.
> >>
> >> So essentially is there a stable authentication handler out there that
> >> replicates htpasswd?
> >>
> >> Thanks,
> >>
> >> - Jim
> >>
> >> *
> >> Jim Klo
> >> Senior Software Engineer
> >> Center for Software Engineering
> >> SRI International
> >> *
> >>
> >>
>

Re: Migrate htpasswd users to _users?

Posted by Jim Klo <ji...@sri.com>.
As we're using whatever the default is on Ubuntu (which is crypt() per manpage http://linux.die.net/man/1/htpasswd)

Is there an existing authentication handler plugin that uses crypt? While I'm not even close to even call myself an Erlang noob - from here it doesn't seem like it would too difficult to alter  https://github.com/apache/couchdb/blob/1.2.x/src/couchdb/couch_httpd_auth.erl but have no idea  where to start on modifying as a plugin. 

Worst case I just make all my users reset their passwords. 

- Jim


Sent from my iPad

On Jun 7, 2012, at 7:12 PM, "Keith Gable" <zi...@ignition-project.com> wrote:

> htpasswd supports several different hash schemes. $apr1$ is the default and
> isn't very portable (though is supported by nginx) because it's not exactly
> MD5 as generated by crypt().
> On Jun 7, 2012 4:15 PM, "Jim Klo" <ji...@sri.com> wrote:
> 
>> Wondering if there is a way to easily migrate a flat file of htpasswd
>> users into couchdb _users?
>> 
>> htpasswd typically uses crypt() which I think i based off a MD5, and
>> couchdb uses SHA1.
>> 
>> So essentially is there a stable authentication handler out there that
>> replicates htpasswd?
>> 
>> Thanks,
>> 
>> - Jim
>> 
>> *
>> Jim Klo
>> Senior Software Engineer
>> Center for Software Engineering
>> SRI International
>> *
>> 
>> 

Re: Migrate htpasswd users to _users?

Posted by Keith Gable <zi...@ignition-project.com>.
htpasswd supports several different hash schemes. $apr1$ is the default and
isn't very portable (though is supported by nginx) because it's not exactly
MD5 as generated by crypt().
On Jun 7, 2012 4:15 PM, "Jim Klo" <ji...@sri.com> wrote:

> Wondering if there is a way to easily migrate a flat file of htpasswd
> users into couchdb _users?
>
> htpasswd typically uses crypt() which I think i based off a MD5, and
> couchdb uses SHA1.
>
> So essentially is there a stable authentication handler out there that
> replicates htpasswd?
>
> Thanks,
>
> - Jim
>
> *
> Jim Klo
> Senior Software Engineer
> Center for Software Engineering
> SRI International
> *
>
>