Closed juulSme closed 7 months ago
does this persist on a SSH session outside of WSL? The installed SSH in WSL is not Win32-OpenSSH, thus is considered out of scope for this repo.
This fixed it for me:
https://github.com/microsoft/WSL/issues/8986#issuecomment-1332413859
in wsl create the file
sudo vim /usr/lib/binfmt.d/WSLInterop.conf
with contents:
:WSLInterop:M::MZ::/init:PF
https://github.com/microsoft/WSL/issues/8986#issuecomment-1332452012
restart systemd services
sudo systemctl restart systemd-binfmt
sudo systemctl restart binfmt-support
If you get an error on restarting, you might need to install binformat support first:
sudo apt update
sudo apt install binfmt-support
if you see
sudo ls -Fal /proc/sys/fs/binfmt_misc
total 0
drwxr-xr-x 2 root root 0 Mar 24 11:11 ./
dr-xr-xr-x 1 root root 0 Mar 24 11:11 ../
-rw-r--r-- 1 root root 0 Mar 24 11:35 WSLInterop
-rw-r--r-- 1 root root 0 Mar 24 11:35 jar
-rw-r--r-- 1 root root 0 Mar 24 11:35 python3.11
--w------- 1 root root 0 Mar 24 11:35 register
-rw-r--r-- 1 root root 0 Mar 24 11:35 status
sudo cat /proc/sys/fs/binfmt_misc/WSLInterop
enabled
interpreter /init
flags: PF
offset 0
magic 4d5a
everything should work fine also with systemd again.
Wonderful, thank you :)
Prerequisites
Steps to reproduce
I'm using a Yubikey-based FIDO2 ED25519 key (non-discoverable) with WSL2 to connect to an external host with SSH using the ssh-sk_helper.exe as explained in the Yubikey docs (
export SSH_SK_HELPER="/mnt/c/Users/me/openssh/ssh-sk-helper.exe"
). The WSL2 distro is Debian, the WSL openssh version isOpenSSH_9.2p1 Debian-2+deb12u1, OpenSSL 3.0.11 19 Sep 2023
, the Windows openssh version of ssh-sk-helper.exe is the latestOpenSSH_for_Windows_9.4p1, LibreSSL 3.7.3
. It works perfectly without having Python installed; I get a Windows prompt asking me to insert the key and touch it. However, when I install Python3, I no longer get the prompt, and the ssh command immediately crashes with obscure output:I install Python using
sudo apt-get install python3 python3-pip python-is-python3 python3-venv
. Removing Python withsudo apt-get remove --purge python3 && sudo apt-get autoremove
, followed by exiting the virtual machine andwsl --shutdown
fixes the issue.Expected behavior
Actual behavior
Error details
No response
Environment data
Version
9,4
Visuals
No response