Created
July 8, 2020 16:43
-
-
Save Speedy37/c8828238e4d869d37b356b422400f871 to your computer and use it in GitHub Desktop.
WSL2 sshd + netsh v4tov4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IP=$(ip -f inet -br addr show eth0 | awk '{match($0,/[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/); ip = substr($0,RSTART,RLENGT> | |
ARGS="interface portproxy add v4tov4 listenport=2222 listenaddress=192.168.1.0 connectport=2222 connectaddress=$IP" | |
powershell.exe -Command "Start-Process netsh.exe -ArgumentList \"$ARGS\" -Verb RunAs" | |
sudo /etc/init.d/ssh start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment