[PSMP] - AD Users Unable to Execute Sudo After PSMP Installation (initgroups Missing in nsswitch.conf)
Symptom
Following the installation of PSMP in Integrated Mode on a Linux server:
1. Active Directory maintenance users can authenticate and establish SSH sessions directly to the Linux OS.
2. When attempting to execute any command with `sudo` (e.g., `sudo su -` or administrative commands), the command fails with:
"<username> is not in the sudoers file. This incident will be reported."
3. Local Linux users (e.g., local root or local admin accounts) can execute `sudo` without issue.
4. The `/etc/sudoers` file and sudoers configuration rules have not changed and still grant permissions to the relevant AD groups (e.g., `%wheel` or `%Domain\ Admins`).
Environment
14.2;14.6;15.0;14.7;14.8;15.2 Privileged Access Manager (PAM, self-hosted);Privilege Cloud PSMP
- Products: Privileged Access Manager (PAM, self-hosted), Privilege Cloud
- Components: Privileged Session Manager for SSH (PSMP)
- Installation Mode: PSMP Integrated Mode
- OS / Platform: Linux (RHEL, CentOS, Rocky Linux) integrated with Active Directory via SSSD
- Affected Versions: PSMP v14.x, v15.x
Cause
During PSMP Integrated Mode installation, the installer modifies `/etc/nsswitch.conf` to direct user and group lookups through the PSMP PAM/NSS modules.
The `initgroups` directive in `/etc/nsswitch.conf` controls how the operating system looks up a user's supplementary group memberships.
If `initgroups` is omitted or does not include `sss` (System Security Services Daemon), the OS fails to query Active Directory for the user's secondary groups upon running `sudo`. Consequently, the OS treats the user as having no supplementary group memberships and denies sudo access.
Resolution
Add `sss` to the `initgroups` directive in `/etc/nsswitch.conf`:
Step 1: Edit /etc/nsswitch.conf
1. Log on to the PSMP server using a local account with root privileges (or directly as `root`).
2. Open `/etc/nsswitch.conf` in a text editor:
sudo vi /etc/nsswitch.conf
3. Locate the `initgroups` line. If it exists, update it as follows; if it is missing, add it to the file:
initgroups: files sss psmp
4. Save and close the file.
Step 2: Refresh SSSD Cache and Service
Apply the configuration without rebooting the server:
1. Invalidate and clear the SSSD cache:
sudo sss_cache -E
2. Restart the SSSD daemon:
sudo systemctl restart sssd
Step 3: Verify Sudo Privileges
1. Log in via SSH as an Active Directory maintenance user.
2. Run the `id` or `groups` command to confirm that supplementary AD groups (e.g., `wheel`) appear in the group list.
3. Test sudo functionality:
sudo whoami
(Verify that the output returns `root`).