Busybox httpd with basic auth

For very simple websites, nothing beats running ‘busybox httpd’.

To build it, download the latest source from: https://busybox.net/downloads/</a>

To compile:

make defconfig
make

To run with basic authentication:

  1. Find out the hash of the password you want to use, for example, if you want to use the password 'secret':
    $ busybox httpd -m secret
    $1$gDqyrCR.$6MSG2JC9CBWRNypWVfuC81
  2. Add the login information to your httpd.conf file. For example, to use user 'fred':
    echo '/:fred:$1$gDqyrCR.$6MSG2JC9CBWRNypWVfuC81' > httpd.conf
  3. Start busybox httpd as follows:
    busybox httpd -v -f -p 5005 -r "Identify yourself:" -c httpd.conf
    Options used: -v: be verbose -f: stay in foreground (don't daemonize) -p: port number -r: authentication realm (i.e. string you want to show the users) -c: configuration file
Avatar
Lydéric Landry
écrivain et éditeur

Après plusieurs vies, j'écris maintenant