Discussion:
apache auth.
(too old to reply)
zeneca
2022-02-26 08:22:57 UTC
Permalink
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
Kees Nuyt
2022-02-26 13:52:16 UTC
Permalink
Post by zeneca
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.
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
Loading...