guest-oslogin: PAM account function broken in 20230919.00

We use the PAM account function as documented in the README, but as of the google-compute-engine-oslogin-20231004 release, PAM account lookups using the pam_oslogin_login.so module fail with the error: PAM unable to resolve symbol: pam_sm_acct_mgmt.

I see the pam_sm_acct_mgmt function was removed in #116. This change broke functionality that we depend on. Can it be reversed?

For reference, our pam configuration uses code like this to apply different policies to oslogin vs local or ldap user accounts (e.g. restricting user account login based on group membership).

account     [success=1 default=ignore]                   pam_oslogin_login.so
account     substack                                     user-policy

The project README documents how to use both the pam_oslogin_login.so and pam_oslogin_admin.so modules in the PAM account stack, so I would expect this functionality to still be supported. (https://github.com/GoogleCloudPlatform/guest-oslogin/tree/master#pam-modules)

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 8
  • Comments: 36 (18 by maintainers)

Commits related to this issue

Most upvoted comments

@gygitlab did you find a solution for this? For us it not only affects su command, but breaks completely SSH connection.

Google support did share with me the following to the sudo su issue I had:

Workaround:

Edit the /etc/pam.d/su file and remove the following block:

# Added by Google Compute Engine OS Login.
account    [success=bad ignore=ignore] pam_oslogin_login.so

I couldn’t say about the SSH issues you are seeing though sorry.

On all of our Ubuntu GCP environments today we’ve noticed sudo su suddenly failing across them all.

We log in with our accounts via oslogin. The error logs point to the removal of pam_oslogin_admin.so as the problem:

sudo su
su: Module is unknown

/var/log/auth.log:
Jan 15 14:58:07 vm-name: PAM unable to dlopen(pam_oslogin_admin.so): /lib/security/pam_oslogin_admin.so: cannot open shared object file: No such file or directory
Jan 15 14:58:07 vm-name: PAM adding faulty module: pam_oslogin_admin.so

I would consider this a significant regression and will likely be impacting many users soon enough presuming the rollout of this change is affecting existing instances that upgrade now. Happy to raise a separate issue if needed here or elsewhere.

Edit - I raised a support ticket for this and it’s been confirmed as an issue on existing systems. Public issue here

@dorileo Looks like we are still experiencing a similar issue with this. Recently upgraded to Ubuntu 22.04 and enabled oslogin, with the google-guest-agent and google-compute-engine-oslogin being at the latest release. We continue to see:

$ sudo su -
su: Module is unknown

After removing the following lines from /etc/pam.d/su, it works:

# Added by Google Compute Engine OS Login.
account    [success=bad ignore=ignore] pam_oslogin_login.so

Versions:

  • google-guest-agent: 20231004.02-0ubuntu1~22.04.4
  • google-compute-engine-oslogin: 20231004.00-0ubuntu1~22.04.3

The PR fixing this issue was merged and it will be available on the next os login release.

Thanks, Leo

@dorileo is there any place where we can track the progress of Canonical fixing the dependency issue? We would like to know if we roll-out manual measures to mitigate this or we can wait a reasonable amount of time for Canonical to fix it. Thanks!

Hi @gerry-tock

BUT the VM that I had an issue with is suddenly working. The /var/google-sudoers.d/ directory is now being automatically updated as we ssh into the VM and therefore we have sudo access now.

That’s expected, we worked with Canonical to have the issue fixed, unattended-upgrade might have picked the new versions and installed to your failing VM.

Thanks, Leo

@dorileo What are the plans to address the original issues? We have customers that can no longer login is as AD user using SSH.

hi @marciobasel in your case you should update also guest-agent package, canonical is working to fix their dependencies in the packages and avoid this case you are describing, but until they do you will need to guarantee that when you update oslogin you also update guest-agent.

Similar issue here. Two of our GCP ubuntu instance suddenly became unable to login.

No SSH from web, no SSH from gcloud command line, even user creation from startup-script won’t work (basically locked-out from these VM).

Mounted these VM disks to other instance, found a bunch of PAM errors in auth.log when trying to login: PAM unable to dlopen(pam_oslogin_admin.so): /lib/security/pam_oslogin_admin.so: cannot open shared object file: No such file or directory

I can confirm I have the exact same issue.

And I can replicate it very easily. Here are the steps:

  • Create a fresh VM with our custom Ubuntu 20.04 which still has the 20200925.00-0ubuntu3~20.04.0 version of google-compute-engine-oslogin installed.
  • Run this: sudo apt-get install google-compute-engine-oslogin
  • Version 20231004.00-0ubuntu1~20.04.2 gets installed (updated, better said)
  • Completely broken, unreachable and same /var/log/auth.log entries. Exactly as HMKRL commented.

This seems quite concerning.

Similar issue here. Two of our GCP ubuntu instance suddenly became unable to login.

No SSH from web, no SSH from gcloud command line, even user creation from startup-script won’t work (basically locked-out from these VM).

Mounted these VM disks to other instance, found a bunch of PAM errors in auth.log when trying to login: PAM unable to dlopen(pam_oslogin_admin.so): /lib/security/pam_oslogin_admin.so: cannot open shared object file: No such file or directory

Hi @gygitlab,

The problem you are reporting is a different issue, it’s that guest-agent is not cleaning up the previous configuration. Thanks for raising it and creating a separate report to it.

Thanks, Leo