PAMAuthenticator Issues

I am having serious issue with this – only admin can login - I can’t login with the student1 or student2 – I keep getting invalid username or password – but admin login successfully - please find my config code below-- help me fix

c.JupyterHub.ip = “127.0.0.1”
c.JupyterHub.port = 8000

c.JupyterHub.spawner_class = “jupyterhub.spawner.LocalProcessSpawner”

c.JupyterHub.authenticator_class = “jupyterhub.auth.PAMAuthenticator”

c.PAMAuthenticator.service = “jupyterhub”
c.PAMAuthenticator.open_sessions = False

c.Authenticator.allowed_users = {“student1”, “student2”}

c.Authenticator.admin_users = {“jhubfresh”}

c.Authenticator.allow_all = False

c.Spawner.cmd = [
“/home/jhubfresh/jupyterhub/jhubenv/bin/jupyterhub-singleuser”
]

c.Spawner.environment = {}

c.JupyterHub.trusted_downstream_ips = [“127.0.0.1”]

The LOG below:

[D 2026-06-22 18:20:53.352 JupyterHub base:1575] Using default error template for 403
[W 2026-06-22 18:20:53.403 JupyterHub log:192] 403 POST /hub/login?next=%2Fhub%2F (@102.91.93.41) 55.61ms
[D 2026-06-22 18:20:53.990 JupyterHub log:192] 304 GET /hub/logo (@102.91.93.41) 8.44ms
[D 2026-06-22 18:20:54.009 JupyterHub log:192] 200 GET /hub/static/components/@fortawesome/fontawesome-free/css/fontawesome.css (@102.91.93.41) 2.63ms
[D 2026-06-22 18:20:54.175 JupyterHub log:192] 200 GET /hub/static/components/@fortawesome/fontawesome-free/css/solid.css (@102.91.93.41) 2.95ms
[D 2026-06-22 18:20:55.764 JupyterHub log:192] 200 GET /hub/static/components/@fortawesome/fontawesome-free/webfonts/fa-solid-900.woff2 (@102.91.93.41) 3.15ms
[E 2026-06-22 18:21:03.840 JupyterHub login:120] XSRF error on login form: HTTP 403: Forbidden (XSRF cookie does not match POST argument)
[W 2026-06-22 18:21:03.841 JupyterHub web:1964] 403 POST /hub/login?next=%2Fhub%2F (102.91.93.41): Login form invalid or expired. Try again.
[D 2026-06-22 18:21:03.841 JupyterHub base:1575] Using default error template for 403
[W 2026-06-22 18:21:03.843 JupyterHub log:192] 403 POST /hub/login?next=%2Fhub%2F (@102.91.93.41) 3.25ms
[D 2026-06-22 18:21:04.318 JupyterHub log:192] 304 GET /hub/static/components/@fortawesome/fontawesome-free/css/fontawesome.css (@102.91.93.41) 1.39ms
[D 2026-06-22 18:21:04.323 JupyterHub log:192] 304 GET /hub/static/components/@fortawesome/fontawesome-free/css/solid.css (@102.91.93.41) 1.16ms
[D 2026-06-22 18:21:04.684 JupyterHub log:192] 304 GET /hub/static/components/@fortawesome/fontawesome-free/webfonts/fa-solid-900.woff2 (@102.91.93.41) 0.79ms
[W 2026-06-22 18:21:13.953 JupyterHub auth:1425] PAM Authentication failed (‘student1’@102.91.93.41): [PAM Error 7] Authentication failure
[W 2026-06-22 18:21:13.954 JupyterHub base:998] Failed login for ‘student1’
[W 2026-06-22 18:21:13.993 JupyterHub log:192] 403 POST /hub/login?next=%2Fhub%2F (@102.91.93.41) 1392.53ms
[D 2026-06-22 18:21:14.343 JupyterHub log:192] 304 GET /hub/static/components/@fortawesome/fontawesome-free/css/fontawesome.css (@102.91.93.41) 1.54ms
[D 2026-06-22 18:21:14.345 JupyterHub log:192] 304 GET /hub/static/components/@fortawesome/fontawesome-free/css/solid.css (@102.91.93.41) 0.76ms
[D 2026-06-22 18:21:14.661 JupyterHub log:192] 304 GET /hub/static/components/@fortawesome/fontawesome-free/webfonts/fa-solid-900.woff2 (@102.91.93.41) 0.80ms

When only one user can login with PAM, that usually means that JupyterHub is being run as a user that doesn’t have permission to check other user passwords, which leads to only that user to be able to login (typically this means read permission on /etc/shadow, but it can be more than that). Running with the default PAM Authenticator and LocalProcessSpawner generally requires the Hub to be root.