Additional configuration options
These are additional configuration options to keep in mind as users configure LDAP-based authentication.
Making customizations to the PAM configuration of Db2
- On RHEL systems run:
cp /etc/pam.d/system-auth /etc/pam.d/db2
- On SLES and Ubuntu systems
run:
cat /etc/pam.d/common-auth /etc/pam.d/common-account /etc/pam.d/common-password /etc/pam.d/common-session > /etc/pam.d/db2
If this step is done, the Db2 authentication configuration will not match the system authentication configuration and future changes made to the system authentication configuration may not be reflected in Db2.
Enforce password history and password quality requirements during a password change
Because the Db2 check password daemons run as the root user, some PAM modules such as
pam_pwhistory
and pam_pwquality
will not enforce password
requirements.
To ensure password quality and history requirements are enforced for a password change, the
enforce_for_root
option must be added to the module's entry in the PAM
configuration file.
Alternate group base DN
[domain/default]
section of the
/etc/sssd/sssd.conf
file:ldap_group_search_base = <Group base DN>
LDAP authenticated bind
[domain/default]
section of the
/etc/sssd/sssd.conf file after running the authconfig or
authselect commands:ldap_default_bind_dn=<bind DN>
ldap_default_authtok=<password>
systemctl restart sssd
Disallow interactive login from all LDAP users by changing the default shell
[domain/default]
section of the
/etc/sssd/sssd.conf file. This will override the shell of all users
authenticated through SSSD and will prevent an interactive login but will allow users to
authenticate with Db2.- For RHEL and SLES:
override_shell = /sbin/nologin
- For Ubuntu:
override_shell = /usr/sbin/nologin
Control who can login to the server using the pam_access module
pam_access
module. It can be enabled using the following commands based on your
operating system:- RHEL 7:
authconfig --enablepamaccess --update
- RHEL 8:
authselect select sssd with with-pamaccess
- SLES:
pam-config --add --access
- Ubuntu: Add the following line to the beginning of
/etc/pam.d/common-account:
account required pam_access.so
+ : root wheel : ALL
+ : db2inst1 : ALL
-: ALL : ALL
This configuration will allow root, members of the wheel group, and the Db2 instance owner
(db2inst1
) access to the system.
- For
RHEL:
grep -v pam_access.so /etc/pam.d/system-auth > /etc/pam.d/db2
- For SLES and Ubuntu:
grep -v pam_access.so /etc/pam.d/common-auth /etc/pam.d/common-account /etc/pam.d/common-password /etc/pam.d/common-session > /etc/pam.d/db2
pam_access.so
module. This will allow any user to connect to Db2, but they will be
denied access to other services in the operating system.