-
Notifications
You must be signed in to change notification settings - Fork 16
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
socket.timeout: timed out
when running under sudo or otherwise as root?
#3
Comments
I assume you applied #2 to get wsl-sudo working on wsl2? Then I would guess that your problem with You could also just permanently disable the password prompt for sudo: https://askubuntu.com/a/147265. I think that is in general a sensible thing to do on WSL. Then you can do |
Thanks for replying. I'm not sure I'm crazy about disabling sudo password prompting. But yes, that is a solution. I don't understand the first part of your reply, though: The
But:
|
#2 does not invent the WSL_INTEROP variable. The call graph of wsl-sudo is: You can have a look at these issues to get more understanding of the situation: microsoft/WSL#4465 and microsoft/WSL#5065. It's possible that you are encountering the latter issue here, when you run wsl.exe from within a wsl prompt. I can't really help you there – these are all undocumented WSL2 internals. |
Is there any way I can use both
wsl-sudo.pl
andsudo
at the same time without having to enter my linux password every time?As I pointed out in #1, wsl-sudo works fine to edit e.g. the hosts file under WSL2, but I also need my script to have linux sudo priviledges.
If I run
sudo asks for a password every time, presumably because wsl-sudo.py creates a new pty for each invocation.
But if I run this (where I preserve the
PATH
so it can find wsl-sudo.py and misc. windows binaries):I'm presented with the UAC prompt but then get this, which I'd like to avoid:
This occurs both if I run as above, if I run
sudo -i
to get an interactive shell, or runwsl -u root
to start a brand new WSL session.The text was updated successfully, but these errors were encountered: