Error -- failed to map user (ood)

hi,please help me, thanks;
use ondemand-2.0.26-1.el7.x86_64

chrome brower show as follows
Error – failed to map user (ood)

/etc/ood/config/ood_portal.yml

auth:
  - 'AuthType Basic'
  - 'AuthName "Open OnDemand"'
  - 'AuthBasicProvider PAM'
  - 'AuthPAMService ood'
  - 'Require valid-user'
user_map_match: '.*'

apache access log as follows:
116.75.220.2 - ood [23/Jun/2022:18:11:46 +0800] “GET /pun/sys/dashboard HTTP/1.1” 404 33 “-” “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36”
116.75.220.2 - ood [23/Jun/2022:18:11:46 +0800] “GET /pun/sys/dashboard HTTP/1.1” 404 33 “-” “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36”

Hi and welcome!

What OS are you on?

Did you follow the steps in the docs here: Add PAM Authentication — Open OnDemand 2.0.20 documentation

Mainly, is the module also enabled after the install?

After setting the ood_portal.yml did you issue the update_ood_portal command?

use CentOS-7.6 x64

according to Add PAM Authentication — Open OnDemand 2.0.20 documentation

Apply modifications
/opt/ood/ood-portal-generator/sbin/update_ood_portal

apache error log as follows:
[Fri Jun 24 10:59:49.312677 2022] [lua:debug] [pid 18035] lua_request.c(1839): [client 106.75.220.2:54645] AH01486: request_rec->dispatching subprocess_env → apr table
[Fri Jun 24 10:59:49.312714 2022] [lua:debug] [pid 18035] lua_request.c(1839): [client 106.75.220.2:54645] AH01486: request_rec->dispatching subprocess_env → apr table
[Fri Jun 24 10:59:49.312718 2022] [lua:debug] [pid 18035] lua_request.c(1839): [client 106.75.220.2:54645] AH01486: request_rec->dispatching subprocess_env → apr table
[Fri Jun 24 10:59:49.312721 2022] [lua:debug] [pid 18035] lua_request.c(1839): [client 106.75.220.2:54645] AH01486: request_rec->dispatching subprocess_env → apr table
[Fri Jun 24 10:59:49.312731 2022] [lua:debug] [pid 18035] lua_request.c(1839): [client 106.75.220.2:54645] AH01486: request_rec->dispatching subprocess_env → apr table
[Fri Jun 24 10:59:49.312734 2022] [lua:debug] [pid 18035] lua_request.c(1839): [client 106.75.220.2:54645] AH01486: request_rec->dispatching subprocess_env → apr table
[Fri Jun 24 10:59:49.312736 2022] [lua:debug] [pid 18035] lua_request.c(1839): [client 106.75.220.2:54645] AH01486: request_rec->dispatching subprocess_env → apr table
[Fri Jun 24 10:59:49.312743 2022] [lua:debug] [pid 18035] lua_request.c(1839): [client 106.75.220.2:54645] AH01486: request_rec->dispatching subprocess_env → apr table
[Fri Jun 24 10:59:49.312759 2022] [lua:debug] [pid 18035] lua_request.c(1839): [client 106.75.220.2:54645] AH01486: request_rec->dispatching subprocess_env → apr table
[Fri Jun 24 10:59:49.312762 2022] [lua:debug] [pid 18035] lua_request.c(1839): [client 106.75.220.2:54645] AH01486: request_rec->dispatching subprocess_env → apr table
[Fri Jun 24 10:59:49.312766 2022] [lua:debug] [pid 18035] lua_request.c(1857): [client 106.75.220.2:54645] AH01488: request_rec->dispatching user → string
[Fri Jun 24 10:59:49.312769 2022] [lua:debug] [pid 18035] lua_request.c(1849): [client 106.75.220.2:54645] AH01487: request_rec->dispatching clock → lua_CFunction
[Fri Jun 24 10:59:49.312774 2022] [lua:debug] [pid 18035] lua_request.c(1849): [client 106.75.220.2:54645] AH01487: request_rec->dispatching clock → lua_CFunction
[Fri Jun 24 10:59:49.312777 2022] [lua:debug] [pid 18035] lua_request.c(1849): [client 106.75.220.2:54645] AH01487: request_rec->dispatching debug → lua_CFunction
[Fri Jun 24 10:59:49.312787 2022] [lua:debug] [pid 18035] @/opt/ood/mod_ood_proxy/lib/ood/user_map.lua(21): [client 106.75.220.2:54645] Mapped ‘ood’ => ‘’ [0.004 ms]
[Fri Jun 24 10:59:49.312789 2022] [lua:debug] [pid 18035] lua_request.c(1857): [client 106.75.220.2:54645] AH01488: request_rec->dispatching user → string
[Fri Jun 24 10:59:49.312793 2022] [lua:debug] [pid 18035] lua_request.c(1849): [client 106.75.220.2:54645] AH01487: request_rec->dispatching write → lua_CFunction
[Fri Jun 24 10:59:49.313067 2022] [lua:debug] [pid 18035] lua_request.c(1839): [client 106.75.220.2:54645] AH01486: request_rec->dispatching subprocess_env → apr table
[Fri Jun 24 10:59:49.313082 2022] [lua:debug] [pid 18035] lua_request.c(1839): [client 106.75.220.2:54645] AH01486: request_rec->dispatching subprocess_env → apr table
[Fri Jun 24 10:59:49.313088 2022] [lua:debug] [pid 18035] lua_request.c(1839): [client 106.75.220.2:54645] AH01486: request_rec->dispatching subprocess_env → apr table

I think you don’t actually have an ood user to map too. That is what does id ood return? I think you need to make the local user ood.

That said - you may as well migrate to Dex + LDAP because local users aren’t likely to be able to use your scheduler. And that’s kind of the whole point of Open OnDemand to get interactive jobs on your resources. But these schedulers are generally tied to LDAP and only accept requests from LDAP users, not local users.

Hi,
check is the file “/opt/ood/ood_auth_map/bin/ood_auth_map.regex” available. Since it was not available in the directory after the installation.

Following is the content of the file “/opt/ood/ood_auth_map/bin/ood_auth_map.regex” and make sure enabled executable bit for the file.

Note: line 2 is commented here, since we want to use same PAM username during login without domain name. If you want to use PAMusername@doaminname for user login. Uncomment line number2 and comment line no 3 in the below file content.

  1. #!/bin/bash
  2. #REX=“([^@]+)@hpcdomain.local
  3. REX=“([^@]+)”
  4. INPUT_USER=“$1”
  5. if [[ $INPUT_USER =~ $REX ]]; then
  6. MATCH=“${BASH_REMATCH[1]}”
  7. echo “$MATCH” | tr ‘[:upper:]’ ‘[:lower:]’
  8. else
  9. logger -t ‘ood-mapping’ “cannot map $INPUT_USER”
  10. exit 1
  11. fi

There are ood users locally,PAM After the error, later switched to ldap.

Versions prior to 2.0 relied on user_map_cmd to do this. Since 2.0 you should use the simpler and faster user_map_match.