Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PAM session completely skipped when running WSL #9881

Closed
1 of 2 tasks
blami opened this issue Mar 31, 2023 · 2 comments
Closed
1 of 2 tasks

PAM session completely skipped when running WSL #9881

blami opened this issue Mar 31, 2023 · 2 comments

Comments

@blami
Copy link

blami commented Mar 31, 2023

Windows Version

Microsoft Windows [Version 10.0.22621.1413]

WSL Version

1.1.6.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

5.15.90.1

Distro Version

Ubuntu 22.04

Other Software

No response

Repro Steps

  • In Ubuntu install PAM module that runs task on login (e.g. libpam-tmpdir which sets TMP)
  • Terminate WSL VM using wsl.exe -t Ubuntu
  • Re-run WSL and check if PAM module caused desired effect (in case of libpam-tmpdir which installs to common-session if TMP environment variable is set to /tmp/user/<UID>

Expected Behavior

PAM module applies desired effect (e.g. setting environment variable in case of libpam-tmpdir) on user session.

Actual Behavior

PAM module does not seem to run at all. PAM does not seem to be invoked in process of obtaining shell.

I only have limited knowledge of how PAM works. We would like to rely on it for setting certain aspects of our development environment as we do on bare-metal Ubuntu installs (so that we don't have discrepancy between both environments). It seems PAM is usually invoked by whatever login manager and not shell (which makes sense). That also renders --shell-type login ineffective.

There's probably some magic in place already as systemd (we have it enabled in [boot] section of wsl.conf) seems to run its own PAM module (sd-pam is visible in systemctl status --user).

I can get this work as expected by doing wsl.exe -d Ubuntu -u root login and logging as desired user, or even su can do. I guess all those commands invoke PAM, but WSLs mechanism to get shell running does not.

Diagnostic Logs

No response

@pqnet
Copy link

pqnet commented Mar 10, 2024

related: #9213

Copy link
Contributor

This issue has been automatically closed since it has not had any activity for the past year. If you're still experiencing this issue please re-file this as a new issue or feature request.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants