-
Notifications
You must be signed in to change notification settings - Fork 305
Description
System information
Operating system (e.g. Ubuntu 22.04): oracle linux 8.5
Do you use selinux? (check with e.g. sestatus): disabled
Steps to reproduce
- Assembled nginx docker container with pam auth module, added apk google-authenticator to container
- /etc/pam.d/nginx contains this:
auth required /lib/security/pam_google_authenticator.so - locally created /root/.google_authenticator - chekcked it via sshd pam, works
- nginx.conf has this in config
load_module /etc/nginx/modules/ngx_http_auth_pam_module.so;
and this in location /
auth_pam "Secure area";
auth_pam_service_name "nginx";
5 launching docker
docker run --name nginx-pam -e TZ="Europe/Moscow" --network host -v /etc/ssl/nginx:/etc/ssl/nginx:ro -v /etc/pam.d/nginx:/etc/pam.d/nginx:ro -v /etc/nginx/nginx.conf:/etc/nginx/nginx.conf:ro -v /root/.google_authenticator:/root/.google_authenticator -d nginx-pam-assemble
When enter http address in browser i see http auth "Secure area", but when enter root and OTP - in logs i see this:
2022/12/30 12:47:26 [error] 23#23: *3 PAM: user 'root' - not authenticated: Authentication failure, client: 1.1.1.1, server: _, request: "GET / HTTP/1.1", host: "2.2.2.2"
If i do something wrong and it cannot work as i expect?