Loading ...
Sorry, an error occurred while loading the content.
 

Re: NSLU2 internal thttpd .htpasswd support

Expand Messages
  • brukernavn32
    ... have used the Linksys internal thttpd server. I have not installed it via ipkg since all the binaries were already part of the stock unslung installation.
    Message 1 of 4 , Feb 20, 2009
      --- In nslu2-linux@yahoogroups.com, Harsh <harshbaste@...> wrote:
      > Ok here goes. As mentioned in the link I sent in my previous mail, I
      have used the Linksys internal thttpd server. I have not installed it
      via ipkg since all the binaries were already part of the stock unslung
      installation.
      >
      > After getting it running with regular static pages and cgi, here is
      what it all looks like :
      >
      > I launch it using a hard link to the original binary (the new file
      is needed for reasons outlined here :
      http://www.nslu2-linux.org/wiki/HowTo/UseTheThttpdWebserver)
      >
      > /opt/sbin/mythttpd -C /opt/etc/mythttpd.conf
      >
      > The config file is as follows:
      >
      > bash-3.2# cat /opt/etc/mythttpd.conf
      > # This section overrides defaults
      > dir=/opt/share/www
      > nochroot
      > nosymlink
      > user=nobody
      > logfile=/opt/var/log/thttpd.log
      > pidfile=/opt/var/run/thttpd.pid
      > cgipat=/cgi-bin/*
      > port=80
      > # nosymlink# default = !chroot
      > # novhost
      > # nocgipat
      > # nothrottles
      > # host=0.0.0.0
      > # charset=iso-8859-1
      >
      > My files are all sitting in /opt/share/www and I have a single
      .htpasswd file in that folder to authenticate requests there.
      >
      > I do get a prompt for the password when I try to http into it but it
      does not accept the password. I tried just copying over the htpasswd
      from /home/httpd/ html/Management/.htpasswd but it didnt recognize
      that password either for some reason and keeps prompting me for it
      even if I enter it correctly. That password does work successfully for
      the regular unslung web admin console so the decode certainly seems to
      work.
      >
      > Even if I somehow did get the default admin password to work, my
      second problem is how to generate that password for a new login for
      myself.
      >
      > I tried making my own version of htpasswd using perl crypt like this :
      >
      > bash-3.2# cat `which htpasswd`
      > #!/usr/bin/perl
      > use strict;
      >
      > my $user = $ARGV[0];
      > my $pass = $ARGV[1];
      > print $user. ":" . crypt($pass, "cg") . "\n";
      >
      > It produces a scrambled admin password identical to what the
      management console uses
      > bash-3.2# htpasswd admin admin
      > admin:cgwvsHpJSf6XU
      > bash-3.2# cat /home/httpd/html/Management/.htpasswd
      > admin:cgwvsHpJSf6XU
      > bash-3.2#
      >

      I'm no where an expert on any of this but there are a couple of things
      I can mention.

      First I like to troubleshoot 'fault' like this as root user so I would
      properly not use 'user=nobody' at this stage.

      As I work from a w2k I used ChaosMD5 to create my password.
      http://www.elgorithms.com/

      Also one could try different way to create the password.
      digest password use this format to create the hash.
      'user:path:passwd' not just the password alone
      But I guess your copy & paiste approach has ensured that the format is
      correct.
    Your message has been successfully submitted and would be delivered to recipients shortly.