Re: apache auth.
Kees Nuyt <[email protected]> Sat, 26 Feb 2022 14:52:16 +0100
| Newsgroups | alt.apache.configuration |
|---|---|
| Organization | KPN B.V. |
| Message-ID | <[email protected]> |
On Sat, 26 Feb 2022 09:22:57 +0100, zeneca <[email protected]> wrote: > Hello, > I would like to have authentication based on random numbers (7) > generated at demand and displayed on a small screen next to the system. > Precisions: > The system run on a raspberry zero, apache, mysql php. > The display is a small nokia 5110 display giving temperature and on > demand a code to used to login as administrator. Other usage doesn't > require login. > The generated code is only to be used once. > Many thanks in advance Configure apache to use basic authentication using .htpasswd https://httpd.apache.org/docs/current/howto/auth.html or any similar method. Write a script that can run a a service, pseudocode: 1- wait for a trigger, e.g. user pressing a button, indicating [s]he wants to login 2- generate a password, e.g. using openssl rand .... 3- generate a .htpasswd file using htpasswd -b .... https://httpd.apache.org/docs/current/programs/htpasswd.html 4- display the password on the display (off topic here) 5- back to step 1 configure systemd to start that script as a service (off topic here). Good luck, enjoy -- Regards, Kees Nuyt