google / google/google-authenticator-libpam

Nginx with PAM authentication through pam_script

Open
#221 23 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
C
Stars
2k
Forks
305
PR merge metrics
No merged PRs in 30d

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

1. Assembled nginx docker container with pam auth module, added apk google-authenticator to container
2. /etc/pam.d/nginx contains this:
`auth required /lib/security/pam_google_authenticator.so`
3. locally created /root/.google_authenticator - chekcked it via sshd pam, works
4. 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?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.