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

autoProxy=true doesn't work for multiple users via su or ssh #10820

Open
1 of 2 tasks
mio-19 opened this issue Nov 24, 2023 · 5 comments
Open
1 of 2 tasks

autoProxy=true doesn't work for multiple users via su or ssh #10820

mio-19 opened this issue Nov 24, 2023 · 5 comments
Labels

Comments

@mio-19
Copy link

mio-19 commented Nov 24, 2023

Windows Version

Microsoft Windows [Version 10.0.22631.2715]

WSL Version

2.0.9.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

5.15.133.1-microsoft-standard-WSL2

Distro Version

Arch

Other Software

No response

Repro Steps

  • setup autoProxy=true
  • install and run sshd
  • ssh into wsl or su -l into another user
  • No proxy env variables

Expected Behavior

Env for other users

Actual Behavior

no

Diagnostic Logs

No response

@zcobol
Copy link

zcobol commented Nov 24, 2023

@mio-19 you might want to look at these su options:

-m, -p, --preserve-environment      do not reset environment variables
-w, --whitelist-environment <list>  don't reset specified variables

Basically, preserve the environment when su-ing!

@chanpreetdhanjal
Copy link

Could you please follow the steps below and attach the diagnostic logs? https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#collect-wsl-logs-for-networking-issues

@mio-19
Copy link
Author

mio-19 commented Dec 19, 2023

Could you please follow the steps below and attach the diagnostic logs? https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#collect-wsl-logs-for-networking-issues

I don't think networking logs would be useful for this issue

@i-curve
Copy link

i-curve commented Dec 20, 2023

2.0.14.0 version also has the problem.

@Renan-Di
Copy link

Renan-Di commented May 2, 2024

This is not a wsl problem, you must configure su/sudo tu propagate env from your user when doing sudo:

echo 'Defaults env_keep += "http_proxy https_proxy no_proxy"' | sudo tee -a /etc/sudoers.d/wsl-setup

With su you could pass -p

https://man7.org/linux/man-pages/man1/su.1.html

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

No branches or pull requests

6 participants